Commit e179427
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
| |||
0 commit comments