Close Issue on Done #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Close Issue on Done | |
on: | |
project_card: | |
types: | |
- moved | |
jobs: | |
close-issue: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check if in "done" column | |
id: check-done-column | |
run: echo "::set-output name=isDone::${{ contains(github.event.project_card.column_name, 'done') }}" | |
- name: Close Issue | |
if: steps.check-done-column.outputs.isDone == 'true' | |
uses: actions/github-script@v5 | |
with: | |
script: | | |
const issueId = context.payload.project_card.content_url.split('/').pop(); | |
await github.issues.update({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: issueId, | |
state: 'closed' | |
}); |