Files
neovim/.github/workflows/reviewers_remove.yml
Justin M. Keyes 122be61ed2 ci(reviewers): inline scripts, drop checkout #40413
Problem:
- The `reviewers_add`/`reviewers_remove` CI jobs checkout the repo only
  for the purpose of `require('…/reviewers_add.js')`.
- `reviewers_remove` also runs on `closed`, so a merged fork PR will trip
  the new allow-unsafe-pr-checkout guard of `actions/checkout@v7`.

Solution:
- Drop the use of `actions/checkout`.
- Inline the script in the CI yaml definitions.
- Also await the mutating calls (previously fire-and-forget) and guard
  empty reviewer lists.
2026-06-25 10:01:09 -04:00

33 lines
906 B
YAML

name: "reviewers: remove"
on:
pull_request_target:
types: [converted_to_draft, closed]
permissions: {}
jobs:
remove-reviewers:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: 'Remove reviewers'
uses: actions/github-script@v9
with:
script: |
const { data } = await github.rest.pulls.listRequestedReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
});
const reviewers = data.users.map((e) => e.login);
if (reviewers.length) {
await github.rest.pulls.removeRequestedReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
reviewers,
});
}