Skip to content

Commit e179427

Browse files
authored
FormatCheck.yml: key concurrency group on PR number, not base ref (#74)
## Summary Small bug in the shared \`FormatCheck.yml\` concurrency config. The group was: \`\`\`yaml concurrency: group: \"\${{ inputs.concurrent-jobs && github.run_id || github.ref }}:\${{ github.workflow }}\" cancel-in-progress: \${{ !inputs.concurrent-jobs && inputs.cancel-in-progress }} \`\`\` For \`pull_request_target\` events, \`github.ref\` is the target branch (\`refs/heads/main\`), so every open PR's format check ended up in the same concurrency group. With \`cancel-in-progress: true\`, whenever any PR triggered a new format check, it cancelled in-progress format checks on all other PRs — which is why PRs frequently show \"Format Check / Check Formatting: cancelled\" for no visible reason. Observed concretely on [ITensor/FunctionImplementations.jl#53](ITensor/FunctionImplementations.jl#53): the Format Check was cancelled when a different CompatHelper PR started a run on the same repo. ## Fix Key the group on \`github.event.pull_request.number\` when it's available, so each PR has its own group. Fall back to \`github.ref\` for non-PR triggers (e.g. scheduled or manual dispatch).
1 parent e82fc4d commit e179427

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/FormatCheck.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ on:
2525
type: boolean
2626

2727
concurrency:
28-
group: "${{ inputs.concurrent-jobs && github.run_id || github.ref }}:${{ github.workflow }}"
28+
# Key on the PR number for `pull_request_target` events; `github.ref` would
29+
# resolve to the target branch (`refs/heads/main`) and would put every PR's
30+
# format check into the same group, causing each new PR to cancel all other
31+
# in-progress format checks across the repo. Fall back to `github.ref` for
32+
# non-PR triggers.
33+
group: "${{ inputs.concurrent-jobs && github.run_id || github.event.pull_request.number || github.ref }}:${{ github.workflow }}"
2934
cancel-in-progress: ${{ !inputs.concurrent-jobs && inputs.cancel-in-progress }}
3035

3136
jobs:

0 commit comments

Comments
 (0)