Skip to content

Commit c1fc1a8

Browse files
ci: add workflow for auto-requesting reviews (canonical#555)
--------- Co-authored-by: Adrian Clay Lake <clay.lake@canonical.com>
1 parent 630b377 commit c1fc1a8

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/triage-prs.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Triage PRs
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened, ready_for_review]
6+
7+
jobs:
8+
add-reviewers:
9+
if: github.repository_owner == 'canonical'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- env:
13+
GITHUB_TOKEN: ${{ secrets.ROCKSBOT_PR_TOKEN }}
14+
REVIEWERS: "slice-reviewers-guild"
15+
run: |
16+
gh api \
17+
--method POST \
18+
-H "Accept: application/vnd.github+json" \
19+
-H "X-GitHub-Api-Version: 2022-11-28" \
20+
/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \
21+
-f "team_reviewers[]=${{ env.REVIEWERS }}"
22+
23+
# Cannot use `gh pr edit`:
24+
# https://github.com/cli/cli/issues/4844

0 commit comments

Comments
 (0)