Skip to content

Feature/merge conflict resolution #8

Feature/merge conflict resolution

Feature/merge conflict resolution #8

Workflow file for this run

name: PR assignment
on:
pull_request_target:
types: [opened, edited, synchronize, reopened, ready_for_review]
permissions:
contents: read
issues: write
pull-requests: write
jobs:
auto-assign:
runs-on: ubuntu-latest
steps:
- name: Request Reviewers
uses: actions/github-script@v6
with:
script: |
const author = context.payload.pull_request.user.login;
let reviewers = ['jinhwankim6557', 'gw-nam', 'yoongyu-lee'];
if (reviewers.includes(author)) {
if(reviewers.length === 1)
reviewers = reviewers.map(reviewer => reviewer === author ? 'mikyung-lee' : reviewer);
else {
reviewers = reviewers.filter(reviewer => reviewer !== author);
}
}
await github.rest.pulls.requestReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
reviewers: reviewers
});
- name: Assign PR author and reviewers
uses: actions/github-script@v6
with:
script: |
const assignees = ['mikyung-lee', 'yoongyu-lee']; // assignees
await github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
assignees: assignees
});