PR CI: cancel superseded merge-queue runs of the same PR (#51247)
* PR CI: cancel superseded merge-queue runs of the same PR
For merge_group events, github.ref contains the base SHA, so the workflow-level
concurrency group changes every time the merge queue rebuilds a PR's group and
the previous run is never cancelled. Compute the PR number from the ref in a
small job and use it in a job-level concurrency group on pr-ci.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review: run concurrency-key only for merge_group
- `concurrency-key` runs only for `merge_group` events, on `ubuntu-slim`.
- `pr-ci` gets `if: !cancelled() && ...` so it still runs when `concurrency-key` is skipped.
- The job-level group falls back to `run-<run_id>` when there is no key, so non-merge-queue runs never share a group.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* PR CI: no token permissions for the concurrency-key job
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>