Skip to content

Commit

Permalink
Add blocked issue workflow
Browse files Browse the repository at this point in the history
Closes #27
  • Loading branch information
baynezy committed Mar 22, 2024
1 parent 7dc95c7 commit 7ed6547
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/blocked-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Blocked Issue Labeler

on:
issues:
types:
- opened
- edited
issue_comment:
types:
- created
- edited

jobs:
add-blocked-label:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Add blocked label if issue is blocked
run: |
body=$BODY
comment=$COMMENT
issue_number=${{ github.event.issue.number }}
# if body contains "blocked" or comment contains "blocked"
# add label "blocked"
if [[ "${body,,}" == *"blocked"* ]] || [[ "${comment,,}" == *"blocked"* ]]; then
echo "Issue is blocked"
echo "Adding blocked label"
gh issue edit $issue_number --add-label blocked
fi
env:
BODY: ${{ github.event.issue.body }}
COMMENT: ${{ github.event.comment.body }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 7ed6547

Please sign in to comment.