Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[infra] Automation: Add release PR reviewers #12982

Merged
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/add-release-reviewers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably not going to work. 🙈
Have you checked cli/cli#7671? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting ... need to look into this ... thanks for pointing it out

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems promissing
cli/cli#4844 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the curl approach for the API, since the gh cli seemingly does not allow for passing in an array of strings 🤷🏼

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it might still fail as the suggestion here: cli/cli#4844 (comment) specifies the write permissions. 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah ... it did fail, but for another reason! :D

steps:
- id: get-members
uses: garnertb/get-team-members@0482f68c88601800f85145570ea93bf8fcfcf46f
with:
org: mui
team_slug: x
role: maintainer
token: ${{ secrets.GITHUB_TOKEN }}

# assign reviewers
- run: "gh pr edit ${{ github.event.pull_request.number }} --add-reviewer ${{ steps.get-members.outputs.members }}"
shell: bash