Skip to content

Commit

Permalink
feat: github actions workflow to close issues automatically when labe…
Browse files Browse the repository at this point in the history
…lled done
  • Loading branch information
maxitect authored Sep 24, 2024
1 parent edf41e3 commit d031f2c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Close Issues with Done Label

on:
issues:
types:
- labeled

jobs:
close_issue_if_done:
runs-on: ubuntu-latest
steps:
- name: Check if the label is "Done"
if: contains(github.event.label.name, 'Done')
run: |
echo "The issue is labeled 'Done', proceeding to close the issue."
curl -X PATCH \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }} \
-d '{"state": "closed"}'

0 comments on commit d031f2c

Please sign in to comment.