From 053d3b0e57fcdd2ec1127d50a8ec064c0340b772 Mon Sep 17 00:00:00 2001 From: Wes Date: Fri, 7 Aug 2026 12:02:08 -0600 Subject: [PATCH] perf(ci): cancel superseded main runs Keep pull request cancellation unchanged while grouping main pushes by ref so newer commits stop obsolete CI runs. Preserve SHA-scoped release runs. Co-authored-by: Carl Signed-off-by: Wes --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 299fc9efe..8ec6fe42f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,8 +5,10 @@ on: pull_request: concurrency: - group: ci-${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} + # Keep only the newest run for each PR and for main. Release runs are never + # cancelled: a newer release push must not evict an older release gate. + group: ci-${{ github.workflow }}-${{ (github.event_name == 'pull_request' || github.ref == 'refs/heads/main') && github.ref || github.sha }} + cancel-in-progress: ${{ github.event_name == 'pull_request' || github.ref == 'refs/heads/main' }} env: CARGO_TERM_COLOR: always