Skip to content

Commit

Permalink
feat: add usable workflow for FE request reviewers
Browse files Browse the repository at this point in the history
  • Loading branch information
zhusee2 committed Dec 30, 2024
1 parent c2cbe6b commit c5901e3
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/fe_assign_pr_reviewer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Request PR reviewers for FE team

on:
workflow_call:
secrets:
search_pr_token:
required: true
GITHUB_TOKEN:
required: true

jobs:
add-reviews:
timeout-minutes: 5
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
# For human-created PRs
- uses: iCHEF/action-request-review@v3
if: ${{ !startsWith(github.actor, 'dependabot') && !contains(github.actor, '[bot]') }}
with:
token: ${{ secrets.search_pr_token }}
config_gist_id: 91ffd6e7318cdf5a02353af0a15e2bcf

# For bot-created PRs
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ contains(github.actor, '[bot]') }}
run: |
gh api \
/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \
--method POST \
-H "X-GitHub-Api-Version: 2022-11-28" \
-f "team_reviewers[]=frontend"

0 comments on commit c5901e3

Please sign in to comment.