Skip to content

(feat)rebrand: NTP - Omnibar rebrand #29

(feat)rebrand: NTP - Omnibar rebrand

(feat)rebrand: NTP - Omnibar rebrand #29

name: Assign Reviewer
on:
pull_request:
types: [assigned]
jobs:
request-review:
if: ${{ !github.event.pull_request.head.repo.fork }}
runs-on: ubuntu-latest
steps:
- name: Request review from assignee
uses: actions/github-script@v9
with:
script: |
const assignee = context.payload.assignee.login;
const prAuthor = context.payload.pull_request.user.login;
if (assignee === prAuthor) {
console.log(`Skipping: ${assignee} is the PR author`);
return;
}
try {
await github.rest.pulls.requestReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
reviewers: [assignee]
});
console.log(`Requested review from ${assignee}`);
} catch (error) {
console.log(`Could not request review from ${assignee}: ${error.message}`);
}