Repository navigation
fix(ci): shard fork web tests so Chromium stops closing mid-run #8
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: PR Limits | ||
|
Check warning on line 1 in .github/workflows/pr-limits.yml
|
||
| # Deterministic PR rules from CONTRIBUTING.md: the open PR limit, the conflict | ||
| # window, and the 72 hour close window that follows a triage notice. | ||
| # | ||
| # Nothing is labeled, commented on, or closed until the repository variable | ||
| # PR_LIMITS_ENFORCE is "true". Until then every run logs what it would do. A | ||
| # sweep reads the variable once when it starts; to stop one, cancel the run. | ||
| on: | ||
| pull_request_target: | ||
| types: [opened, reopened] | ||
| schedule: | ||
| - cron: "23 5 * * *" | ||
| workflow_dispatch: | ||
| inputs: | ||
| dry_run: | ||
| description: Log what the sweep would do without labeling, commenting, or closing. | ||
| type: boolean | ||
| default: true | ||
| permissions: | ||
| contents: read | ||
| issues: write | ||
| pull-requests: write | ||
| jobs: | ||
| open-limit: | ||
| name: Open PR limit | ||
| if: github.event_name == 'pull_request_target' | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| # pull_request_target has a write token. Load the script from the default | ||
| # branch and never run PR code. Cone mode also checks out the files beside | ||
| # .github/scripts, which is where TRIAGE_EXEMPTIONS.td and VOUCHED.td live. | ||
| - name: Checkout trusted scripts | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.event.repository.default_branch }} | ||
| sparse-checkout: .github/scripts | ||
| - name: Close PRs over the limit | ||
| uses: actions/github-script@v8 | ||
| env: | ||
| DRY_RUN: ${{ vars.PR_LIMITS_ENFORCE != 'true' }} | ||
| with: | ||
| script: | | ||
| const limits = require("./.github/scripts/pr-limits.cjs"); | ||
| await limits.enforceOpenLimit({ github, context, core, dryRun: process.env.DRY_RUN === "true" }); | ||
| sweep: | ||
| name: Conflict and close windows | ||
| if: github.event_name != 'pull_request_target' | ||
| runs-on: ubuntu-24.04 | ||
| concurrency: | ||
| group: pr-limits-sweep | ||
| cancel-in-progress: false | ||
| steps: | ||
| - name: Checkout trusted scripts | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.event.repository.default_branch }} | ||
| sparse-checkout: .github/scripts | ||
| - name: Request rebases and close what went unanswered | ||
| uses: actions/github-script@v8 | ||
| env: | ||
| DRY_RUN: ${{ vars.PR_LIMITS_ENFORCE != 'true' || (github.event_name == 'workflow_dispatch' && inputs.dry_run) }} | ||
| with: | ||
| script: | | ||
| const limits = require("./.github/scripts/pr-limits.cjs"); | ||
| await limits.sweep({ github, context, core, dryRun: process.env.DRY_RUN === "true" }); | ||