Skip to content

Commit

Permalink
[infra] changed to usage of reusable workflow (mui#13017)
Browse files Browse the repository at this point in the history
  • Loading branch information
michelengelen authored and DungTiger committed Jul 23, 2024
1 parent 1359339 commit 6891f01
Showing 1 changed file with 7 additions and 32 deletions.
39 changes: 7 additions & 32 deletions .github/workflows/add-release-reviewers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,10 @@ on:
permissions: {}

jobs:
add-reviewers:
# Tests that label is added on the PR
if: ${{ github.event.label.name == 'release' }}
runs-on: ubuntu-latest
env:
ORG: ${{ github.event.organization }}
# we can use the team slug when making this a reusable workflow
TEAM_SLUG: x
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
pull-requests: write
steps:
- id: get-members
run: |
DATA=$(gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/orgs/$ORG/teams/$TEAM_SLUG/members?role=maintainer&per_page=100 \
| jq 'reduce inputs as $i (.; . += $i)') \
echo "data=$DATA" >> $GITHUB_OUTPUT
# assign reviewers
- id: assign-reviewers
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$ORG/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \
-d '{"reviewers":[${{ join(fromJson(steps.get-members.outputs.data).*.login) }}]}' \
add-reviewers-to-release-pr:
uses: mui/mui-public/.github/workflows/reusable-add-reviewers-to-pr.yml@2e8907ef6d60b6e60c058c110d61bd07c9ae8c43
with:
team-slug: x
label-name: release
secrets:
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 6891f01

Please sign in to comment.