| 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 |
permissions: |
| 10 |
contents: read |
| 11 |
issues: write |
| 12 |
|
| 13 |
env: |
| 14 |
FEEDBACK_LBL: pending::feedback |
| 15 |
SUPPORT_LBL: pending::support |
| 16 |
|
| 17 |
jobs: |
| 18 |
# NOTE: will update label if anyone responds, not just the author/reporter |
| 19 |
# TODO: create conda-issue-sorting team and modify this to toggle label based on |
| 20 |
# whether a non-issue-sorting engineer commented |
| 21 |
pending_support: |
| 22 |
# if [pending::feedback] and anyone responds |
| 23 |
if: >- |
| 24 |
!github.event.repository.fork |
| 25 |
&& !github.event.issue.pull_request |
| 26 |
&& contains(github.event.issue.labels.*.name, 'pending::feedback') |
| 27 |
runs-on: ubuntu-slim |
| 28 |
steps: |
| 29 |
# remove [pending::feedback] |
| 30 |
- uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0 |
| 31 |
with: |
| 32 |
labels: ${{ env.FEEDBACK_LBL }} |
| 33 |
github_token: ${{ secrets.PROJECT_TOKEN }} |
| 34 |
# add [pending::support], if still open |
| 35 |
- uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3 |
| 36 |
if: github.event.issue.state == 'open' |
| 37 |
with: |
| 38 |
labels: ${{ env.SUPPORT_LBL }} |
| 39 |
github_token: ${{ secrets.PROJECT_TOKEN }} |