Skip to content

Commit 6a27ea9

Browse files
committed
Add GitHub workflows to auto-label PRs
1 parent 52ecfeb commit 6a27ea9

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Handle GitHub PR Review responses
3+
4+
on:
5+
pull_request_review:
6+
types:
7+
- submitted
8+
9+
permissions:
10+
pull-requests: write
11+
12+
jobs:
13+
# Label PR as "waiting-author-response" when changes are requested
14+
review-changes-requested:
15+
runs-on: ubuntu-latest
16+
if: github.event.review.state == 'changes_requested' && github.repository == 'stackhpc/stackhpc-kayobe-config'
17+
steps:
18+
- name: Update PR Labels
19+
run: |
20+
gh pr edit "$PR_NUMBER" --remove-label "waiting-review" || true
21+
gh pr edit "$PR_NUMBER" --add-label "waiting-author-response"
22+
env:
23+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
GH_REPO: ${{ github.repository }}
25+
PR_NUMBER: ${{ github.event.pull_request.number }}

.github/workflows/stackhpc-pull-request.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ name: Pull request
88
'on':
99
pull_request:
1010
jobs:
11+
# Label all newly-opened PRs as "waiting-review"
12+
auto-label:
13+
runs-on: ubuntu-latest
14+
if: github.event.action == 'opened' && github.repository == 'stackhpc/stackhpc-kayobe-config'
15+
permissions:
16+
pull-requests: write
17+
steps:
18+
- name: Add waiting-review label
19+
run: gh pr edit "$PR_NUMBER" --add-label "waiting-review"
20+
env:
21+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
GH_REPO: ${{ github.repository }}
23+
PR_NUMBER: ${{ github.event.pull_request.number }}
24+
1125
# Detect which files have changed and use this to run jobs conditionally.
1226
# Note that we can't use the workflow-level paths attribute since this
1327
# would skip the workflow entirely, and would prevent us from making the

0 commit comments

Comments
 (0)