From 4e1ce7a1da7df9fc1b8152f0443e38641451f14f Mon Sep 17 00:00:00 2001 From: Matt Fishman Date: Wed, 22 Apr 2026 23:32:06 -0400 Subject: [PATCH] FormatCheck.yml: key concurrency group on PR number, not base ref For `pull_request_target` events, `github.ref` resolves to the target branch (typically `refs/heads/main`), not the PR head. With `cancel-in-progress: true`, that put every PR's format check into the same concurrency group: any new PR would cancel in-progress format checks on all other PRs across the repo. Key the group on `github.event.pull_request.number` when a PR context is available, falling back to `github.ref` otherwise. Each PR now cancels only its own previous runs. --- .github/workflows/FormatCheck.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml index dd37388..e317a7e 100644 --- a/.github/workflows/FormatCheck.yml +++ b/.github/workflows/FormatCheck.yml @@ -25,7 +25,12 @@ on: type: boolean concurrency: - group: "${{ inputs.concurrent-jobs && github.run_id || github.ref }}:${{ github.workflow }}" + # Key on the PR number for `pull_request_target` events; `github.ref` would + # resolve to the target branch (`refs/heads/main`) and would put every PR's + # format check into the same group, causing each new PR to cancel all other + # in-progress format checks across the repo. Fall back to `github.ref` for + # non-PR triggers. + group: "${{ inputs.concurrent-jobs && github.run_id || github.event.pull_request.number || github.ref }}:${{ github.workflow }}" cancel-in-progress: ${{ !inputs.concurrent-jobs && inputs.cancel-in-progress }} jobs: