mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
Merge pull request #17888 from dundargoc/ci/remove-reviewers-when-drafting
This commit is contained in:
commit
dbcb76bd7a
16
.github/scripts/remove-reviewers.js
vendored
Normal file
16
.github/scripts/remove-reviewers.js
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
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)
|
||||
|
||||
github.rest.pulls.removeRequestedReviewers({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.issue.number,
|
||||
reviewers: reviewers
|
||||
});
|
||||
}
|
17
.github/workflows/remove-reviewers-on-draft.yml
vendored
Normal file
17
.github/workflows/remove-reviewers-on-draft.yml
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
name: "Remove reviewers"
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [converted_to_draft, closed]
|
||||
jobs:
|
||||
remove-reviewers:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: 'Remove reviewers'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const script = require('./.github/scripts/remove-reviewers.js')
|
||||
await script({github, context})
|
Loading…
Reference in New Issue
Block a user