Bug 388 : Issue on Components Edition Information Alignment Issue #156
This file contains 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: 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 | |
}); |