Stop pull request builds cancelling a deploy in flight - #5
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every run in this workflow joined a single concurrency group named
pages, withcancel-in-progress: true. The workflow triggers on bothpush: mainandpull_request: main, so any pull request build evicted whatever was already running — including a deploy ofmain.That is not hypothetical; it happened this morning:
The pull request build had nothing to deploy.
upload-pages-artifactand the wholedeployjob are gated ongithub.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 whilemainwas deploying before, so it had never shown.The cancel is worth keeping for the case it was written for — a newer push to
mainsuperseding an older deploy — so this makes the group per ref rather than removing it:Two pushes to
mainstill 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.