From 99878fc2f57d20885c4b52c396ab8c726ee89576 Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Mon, 3 Aug 2026 23:34:22 +0000 Subject: [PATCH] ci: cancel superseded Check runs Each ref now has one concurrency group, so pushing again to a PR branch or landing another merge cancels the run that is already in flight. The macOS test job takes 3-5 minutes, so without this a burst of pushes queues several runs whose results are obsolete before they finish. github.ref keys the group, which keeps refs isolated: pull_request runs use refs/pull/N/merge and push runs use refs/heads/main, so a merge to main never cancels an open PR's run, and PRs never cancel each other. Note this trades away per-commit coverage on main: in a rapid series of merges only the newest commit keeps a completed run. The tip of main is always verified; intermediate commits may not be. To keep every main commit built, make cancellation conditional instead: cancel-in-progress: ${{ github.event_name == 'pull_request' }} Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/check.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 47f37323a..41f213d79 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -8,6 +8,10 @@ on: branches: - main +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: check: runs-on: macos-15