Skip to content

Commit bfb52ef

Browse files
authored
chore: add issue labels workflow (#338)
1 parent b53e690 commit bfb52ef

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/issue-labels.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Update labels on issues with OP response
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
label-op-response:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check if the comment is from the OP
12+
id: check-op
13+
run: |
14+
OP=${{ github.event.issue.user.login }}
15+
COMMENTER=${{ github.event.comment.user.login }}
16+
if [ "$OP" = "$COMMENTER" ]; then
17+
echo "op_comment=true" >> $GITHUB_ENV
18+
else
19+
echo "op_comment=false" >> $GITHUB_ENV
20+
fi
21+
- name: Add 'Needs Attention' label if OP responded
22+
if: env.op_comment == 'true'
23+
uses: actions-ecosystem/action-add-labels@v1
24+
with:
25+
labels: 'Needs Attention'
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
28+
- name: Remove 'blocked customer-response' label if OP responded
29+
if: env.op_comment == 'true'
30+
uses: actions-ecosystem/action-remove-labels@v1
31+
with:
32+
labels: 'blocked: customer-response'
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

0 commit comments

Comments
 (0)