Skip to content

Bug 388 : Issue on Components Edition Information Alignment Issue #156

Bug 388 : Issue on Components Edition Information Alignment Issue

Bug 388 : Issue on Components Edition Information Alignment Issue #156

name: Add Required Reviewer in PR
on:
pull_request:
types:
- opened
- reopened
- edited
- review_request_removed
permissions:
pull-requests: none
jobs:
assign:
runs-on: ubuntu-latest
steps:
- name: Set user as reviewer
uses: actions/github-script@v6
with:
github-token: ${{ secrets.PR_GITHUB_TOKEN }}
script: |
const author = context.payload.pull_request.user.login;
const userA = "kaushikgokhale";
const userB = "suraj-khupse";
let requiredReviewers = [];
if (author === userA) {
requiredReviewers.push(userB);
} else if (author === userB) {
requiredReviewers.push(userA);
} else {
requiredReviewers.push(userA, userB);
}
requiredReviewers = [...new Set(requiredReviewers)];
await github.rest.pulls.requestReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
reviewers: requiredReviewers
});