From 235b1e9045541bb6eb8757d5d5c2a0466c226bbd Mon Sep 17 00:00:00 2001 From: Sam Goodwin Date: Wed, 7 Oct 2026 01:43:40 -0700 Subject: [PATCH] chore(ci): stop merged PRs' cleanup runs from cancelling main A merged PR's `closed` run has github.ref = refs/heads/main, so it joined main's concurrency group with cancel-in-progress and cancelled the push run. Group pull_request runs by PR number instead. Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index acd0203..59bdf39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,9 @@ on: types: [opened, reopened, synchronize, closed] concurrency: - group: ci-${{ github.ref }} + # Grouped by PR number, not github.ref: a merged PR's `closed` run has + # github.ref = refs/heads/main and would otherwise cancel main's push run. + group: ci-${{ github.event.pull_request.number && format('pr-{0}', github.event.pull_request.number) || github.ref }} # A new push to a PR supersedes its in-progress run; main runs in order. cancel-in-progress: ${{ github.event_name == 'pull_request' }}