Skip to content

Stop pull request builds cancelling a deploy in flight - #5

Merged
mgravell merged 1 commit into
mainfrom
ci-concurrency
Aug 24, 2026
Merged

mgravell merged 1 commit into
mainfrom
ci-concurrency

Conversation

@mgravell

Copy link
Copy Markdown
Member

Every run in this workflow joined a single concurrency group named pages, with cancel-in-progress: true. The workflow triggers on both push: main and pull_request: main, so any pull request build evicted whatever was already running — including a deploy of main.

That is not hypothetical; it happened this morning:

10:48:06  push main            -> cancelled a minute in
10:49:15  pull_request         -> success

The pull request build had nothing to deploy. upload-pages-artifact and the whole deploy job are gated on github.event_name != 'pull_request', so it cancelled a real deploy in order to run a build whose output it throws away. Nothing had pushed a branch while main was deploying before, so it had never shown.

The cancel is worth keeping for the case it was written for — a newer push to main superseding an older deploy — so this makes the group per ref rather than removing it:

group: pages-${{ github.ref }}

Two pushes to main still serialise and the newer still wins. Pull request builds now sit in their own group per branch, so a second push to a branch still cancels its own earlier build. Since those runs never deploy, there is still no path to two Pages deployments at once.

Every run joined one concurrency group named "pages", with cancel-in-progress,
so any pull request build evicted whatever was already running - including a
deploy of main. That happened this morning: main was pushed at 10:48 and a pull
request at 10:49 killed it a minute in.

The cancel is worth keeping for its actual purpose, which is a newer push to
main superseding an older deploy, so the group is now per ref. Pull request
builds never publish anything - upload-pages-artifact and the deploy job are
both gated on the event not being a pull request - so there is still no way to
get two Pages deployments running at once.
@mgravell
mgravell merged commit 5f42390 into main Aug 24, 2026
2 checks passed
@mgravell
mgravell deleted the ci-concurrency branch August 25, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant