# Checks that a pull request is ready for review (CONTRIBUTING.md, "When a PR is ready for review"). # pull_request_target so it also runs on forks of first-time contributors without approval. # It checks out main only and reads the PR as data through the API: never check out or run PR code here. name: PR gate on: pull_request_target: types: [opened, edited, synchronize, reopened, ready_for_review, labeled, unlabeled] workflow_dispatch: permissions: contents: read issues: write pull-requests: write concurrency: group: pr-gate-${{ github.event.pull_request.number || 'all' }} cancel-in-progress: true jobs: gate: name: Ready for review runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@v6 with: ref: ${{ github.event.repository.default_branch }} persist-credentials: false sparse-checkout: .github/scripts - name: Check env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_NUMBER: ${{ github.event.pull_request.number }} run: python3 -I .github/scripts/pr_gate.py