fix(ci): check branch existence instead of open PRs for checkout strategy#325
Open
spbsoluble wants to merge 6 commits intomainfrom
Open
fix(ci): check branch existence instead of open PRs for checkout strategy#325spbsoluble wants to merge 6 commits intomainfrom
spbsoluble wants to merge 6 commits intomainfrom
Conversation
…tegy The update-stores workflow was failing with a non-fast-forward push error when a branch already existed remotely but had no open PR. The check-branch step only queried open PRs to determine whether to create or commit to a branch, so an orphaned remote branch would always trigger the 'create' path, causing the push to be rejected. Fix by checking actual branch existence via git.getRef, using that to select the checkout strategy (commit vs create), and separately tracking HAS_OPEN_PR to control PR creation. Also adds a schedule trigger (daily at midnight UTC) with default inputs of all/latest.
- actions/checkout v4 -> v6 - actions/github-script v7 -> v9 - actions/upload-artifact v4 -> v7 - Keyfactor/add-and-commit v9.1.3 -> v9.1.4 Addresses Node.js 20 deprecation warnings from the previous run.
New Pull Request - all:latest
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.
Summary
update-stores.ymlwhen a remote branch already exists but has no open PRgit.getRefinstead of inferring it from open PRsHAS_OPEN_PRis tracked as a separate output to control whether a new PR should be openedscheduletrigger (midnight UTC) with default inputsall/latestRoot Cause
The
Check Open PRs for Existing Branchstep used open PR existence as a proxy for branch existence. When a branch existed remotely with no open PR, the workflow chose thecreatepath, checked outmain, and tried to push to the existing remote branch — resulting in a non-fast-forward rejection.Test plan
allbranch without the push error