From 6db889493762a2d79dc33a43cc7a6c922f8b5c09 Mon Sep 17 00:00:00 2001 From: flash2do Date: Fri, 6 Nov 2026 12:50:08 -0800 Subject: [PATCH] Cancel main's older CI run when a newer merge lands Merging eleven PRs at 18:39 on Nov 6 started eleven full runs on main. Each needed about 5 minutes, but they queued behind the macOS runner limit for up to 62 minutes and held the doorbell PR's checks for 11. Every merge was already tested on its PR and the newest main run covers all of them, so main pushes now share one concurrency group and a newer one cancels the older. --- .github/workflows/test.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b79ee9e..cc15c77 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,10 +13,14 @@ on: permissions: contents: read -# A new commit on a PR cancels the run it replaces. Runs on main all finish. +# A new commit on a PR cancels the run it replaces, and a new merge cancels +# main's older run: each merge was already tested on its PR, and the latest run +# tests everything merged before it. Without this, merging a batch of PRs queued +# one full macOS run per merge and held other PRs' checks for up to an hour. +# Manual runs never cancel each other. concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.event_name == 'push' && github.ref) || github.run_id }} + cancel-in-progress: ${{ github.event_name != 'workflow_dispatch' }} # Agent homes inside the workspace, never the runner's own: `keys setup` and MCP # registration resolve their config files from these, and no test may reach a real one.