generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce00684
commit e749c5b
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
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' | ||
}); |