Skip to content

Commit c5901e3

Browse files
committed
feat: add usable workflow for FE request reviewers
1 parent c2cbe6b commit c5901e3

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Request PR reviewers for FE team
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
search_pr_token:
7+
required: true
8+
GITHUB_TOKEN:
9+
required: true
10+
11+
jobs:
12+
add-reviews:
13+
timeout-minutes: 5
14+
runs-on: ubuntu-latest
15+
permissions:
16+
pull-requests: write
17+
steps:
18+
# For human-created PRs
19+
- uses: iCHEF/action-request-review@v3
20+
if: ${{ !startsWith(github.actor, 'dependabot') && !contains(github.actor, '[bot]') }}
21+
with:
22+
token: ${{ secrets.search_pr_token }}
23+
config_gist_id: 91ffd6e7318cdf5a02353af0a15e2bcf
24+
25+
# For bot-created PRs
26+
- env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
if: ${{ contains(github.actor, '[bot]') }}
29+
run: |
30+
gh api \
31+
/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \
32+
--method POST \
33+
-H "X-GitHub-Api-Version: 2022-11-28" \
34+
-f "team_reviewers[]=frontend"

0 commit comments

Comments
 (0)