gh-126081: For PRs labeled with "type-feature", require a core review #126832
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: Check labels | |
| on: | |
| pull_request: | |
| types: [opened, reopened, labeled, unlabeled, synchronize] | |
| permissions: | |
| issues: write | |
| pull-requests: write | |
| jobs: | |
| label-dnm: | |
| name: DO-NOT-MERGE | |
| if: github.repository_owner == 'python' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Check there's no DO-NOT-MERGE | |
| uses: mheap/github-action-required-labels@v5 | |
| with: | |
| mode: exactly | |
| count: 0 | |
| labels: | | |
| DO-NOT-MERGE | |
| label-reviews: | |
| name: DO-NOT-MERGE / unresolved review | |
| if: github.repository_owner == 'python' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Check there's no required changes | |
| uses: mheap/github-action-required-labels@v5 | |
| with: | |
| mode: exactly | |
| count: 0 | |
| labels: | | |
| awaiting changes | |
| awaiting change review | |
| - id: is-feature | |
| name: Check for type-feature label | |
| uses: mheap/github-action-required-labels@v5 | |
| with: | |
| mode: exactly | |
| count: 1 | |
| labels: | | |
| type-feature | |
| exit_type: success | |
| - id: awaiting-merge | |
| name: Check for complete review | |
| uses: mheap/github-action-required-labels@v5 | |
| with: | |
| mode: exactly | |
| count: 1 | |
| labels: | | |
| awaiting merge | |
| exit_type: success | |
| - name: Don't accept feature PRs with no review | |
| if: steps.is-feature.outputs.status == 'success' && steps.awaiting-merge.outputs.status == 'failure' | |
| run: exit 1 |