Skip the PR build check if the PR already merged - #351
Merged
Merged
Conversation
Marking a CMS entry Ready and clicking Publish happen seconds apart in Decap. The build job (triggered by the Ready label) sometimes starts just before the merge, and its checkout then fails with 'couldn't find remote ref refs/pull/N/merge' once GitHub drops that ref on merge — a false alarm, since this check was never required to merge and the content lands on main fine either way. Skip the job outright once the PR is already merged, instead of letting checkout fail.
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.
Two PR build checks failed this morning (#350 and a sibling), both with:
Root cause: marking a CMS entry Ready and clicking Publish happen seconds apart in Decap (13s apart for #350). The build job, triggered by the Ready label since #340, sometimes starts just before the merge and loses the race — its checkout then fails because GitHub drops
refs/pull/N/mergethe instant the PR merges.Impact: none. This check was never required to merge (verified against the branch ruleset), so both PRs merged and deployed fine despite the red X. Purely a false alarm.
Fix: skip the build job outright once
github.event.pull_request.mergedis true, instead of letting checkout fail on a ref that's already gone.