mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 13:15:09 -07:00
ef95174694
Using team reviewers when possible reduces the churn on the git history as we'll be able to add or remove reviewers without needing to change the workflow files. This requires using Github fine-grained personal access tokens with Pull Requests set to "Read and write" and Members to "Read-only".
19 lines
588 B
JavaScript
19 lines
588 B
JavaScript
module.exports = async ({github, context}) => {
|
|
const requestedReviewers = await github.rest.pulls.listRequestedReviewers({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
pull_number: context.issue.number
|
|
});
|
|
|
|
const reviewers = requestedReviewers.data.users.map(e => e.login)
|
|
const team_reviewers = requestedReviewers.data.teams.map(e => e.name);
|
|
|
|
github.rest.pulls.removeRequestedReviewers({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
pull_number: context.issue.number,
|
|
reviewers: reviewers,
|
|
team_reviewers: team_reviewers
|
|
});
|
|
}
|