neovim/.github/workflows/add-reviewers.yml
dundargoc ef95174694
ci: add team reviewers (#21434)
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".
2022-12-15 20:40:30 +01:00

20 lines
605 B
YAML

name: "Request reviews"
on:
pull_request_target:
types: [labeled, ready_for_review, reopened]
jobs:
request-reviewer:
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: 'Request reviewers'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.TEAM_REVIEW }}
script: |
const script = require('./.github/scripts/reviews.js')
await script({github, context})