[DO NOT MERGE] Enable Privacy Pro Rebranding #1251
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto Assign Assignees as Reviewers | |
on: | |
pull_request: | |
types: [opened, ready_for_review, reopened, synchronize, assigned, unassigned] | |
jobs: | |
assign-and-request-review: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Get PR details | |
id: pr | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const pr = await github.rest.pulls.get({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: context.payload.pull_request.number, | |
}); | |
const assignees = pr.data.assignees.map(a => a.login) | |
if (assignees.length > 0) { | |
await github.rest.pulls.requestReviewers({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: context.payload.pull_request.number, | |
reviewers: assignees | |
}); | |
} |