Skip to content

[mock] Testing the auto-assign PR functionality #26

[mock] Testing the auto-assign PR functionality

[mock] Testing the auto-assign PR functionality #26

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 }}
PER_MODULE_REVIEWER_LIMIT: '2'
run: |
python3 .github/scripts/assign_reviewers.py \
${{ github.event.inputs.dry_run == 'true' && '--dry-run' || '' }} \
${{ github.event.inputs.force_assign == 'true' && '--force-assign' || '' }}