[mock] Testing the auto-assign PR functionality #18
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' || '' }} |