neovim/.github/scripts/remove-reviewers.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
588 B
JavaScript
Raw Normal View History

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
});
}