2022-03-27 12:48:28 -07:00
|
|
|
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)
|
2022-12-15 12:40:30 -07:00
|
|
|
const team_reviewers = requestedReviewers.data.teams.map(e => e.name);
|
2022-03-27 12:48:28 -07:00
|
|
|
|
|
|
|
github.rest.pulls.removeRequestedReviewers({
|
|
|
|
owner: context.repo.owner,
|
|
|
|
repo: context.repo.repo,
|
|
|
|
pull_number: context.issue.number,
|
2022-12-15 12:40:30 -07:00
|
|
|
reviewers: reviewers,
|
|
|
|
team_reviewers: team_reviewers
|
2022-03-27 12:48:28 -07:00
|
|
|
});
|
|
|
|
}
|