-
Notifications
You must be signed in to change notification settings - Fork 2.2k
41 lines (41 loc) · 1.33 KB
/
auto-assign-reviewers.yml
File metadata and controls
41 lines (41 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Auto assign reviewers
on:
pull_request_target:
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
pr_number:
description: 'PR number to test assignment on'
required: true
type: string
dry_run:
description: 'Run in dry-run mode (just print commands)'
required: false
type: boolean
default: false
force_assign:
description: 'Force assign even if reviewers already exist'
required: false
type: boolean
default: false
jobs:
assign:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Assign reviewers
env:
PR_NUMBER: ${{ github.event.inputs.pr_number || github.event.pull_request.number }}
PR_AUTHOR: ${{ github.event.pull_request.user.login || github.event.inputs.pr_author || '' }}
GH_TOKEN: ${{ secrets.REVIEW_ASSIGNING_TOKEN }}
REVIEWER_LIMIT: '3'
run: |
python3 .github/scripts/assign_reviewers.py \
${{ github.event.inputs.dry_run == 'true' && '--dry-run' || '' }} \
${{ github.event.inputs.force_assign == 'true' && '--force-assign' || '' }}