Skip to content

Commit

Permalink
[infra] Automation: Add release PR reviewers (#12982)
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Engelen <[email protected]>
Co-authored-by: Jose C Quintas Jr <[email protected]>
  • Loading branch information
michelengelen and JCQuintas authored May 3, 2024
1 parent 02edab4 commit eea77d7
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/add-release-reviewers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Add reviewers to release PRs

on:
pull_request_target:
branches: ['master', 'next']
types: ['labeled']

permissions: {}

jobs:
add-reviewers:
if: ${{ github.event.label.name == 'release' }}
# Tests that label is added on the PR
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- id: get-members
uses: garnertb/get-team-members@0482f68c88601800f85145570ea93bf8fcfcf46f
with:
org: mui
team_slug: x
role: maintainer
token: ${{ secrets.GITHUB_TOKEN }}

# assign reviewers
- name: Add reviewer
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \
-d '{"reviewers":[${{ steps.get-members.outputs.members }}]}' \
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit eea77d7

Please sign in to comment.