Debian Codegraph @

.github/workflows/issues.yml

raw
1 name: Automate Issues
2
3 on:
4 # NOTE: github.event is issue_comment payload:
5 # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#issue_comment
6 issue_comment:
7 types: [created]
8
9 concurrency:
10 group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}
11 cancel-in-progress: true
12
13 # built-in GitHub token/permissions are not used
14 permissions: {}
15
16 env:
17 FEEDBACK_LBL: pending::feedback
18 SUPPORT_LBL: pending::support
19
20 jobs:
21 # NOTE: will update label if anyone responds, not just the author/reporter
22 pending_support:
23 name: Update pending support label
24 # if [pending::feedback] and anyone responds
25 if: >-
26 !github.event.repository.fork
27 && !github.event.issue.pull_request
28 && contains(github.event.issue.labels.*.name, 'pending::feedback')
29 runs-on: ubuntu-slim
30 steps:
31 # remove [pending::feedback]
32 - run: gh issue edit --remove-label "${FEEDBACK_LBL}"
33 env:
34 GITHUB_TOKEN: ${{ secrets.PROJECT_TOKEN }}
35
36 # add [pending::support], if still open
37 - if: github.event.issue.state == 'open'
38 run: gh issue edit --add-label "${SUPPORT_LBL}"
39 env:
40 GITHUB_TOKEN: ${{ secrets.PROJECT_TOKEN }}