Skip to content

fix(ci): check branch existence instead of open PRs for checkout strategy#325

Open
spbsoluble wants to merge 6 commits intomainfrom
fix/update-stores-branch-existence-check
Open

fix(ci): check branch existence instead of open PRs for checkout strategy#325
spbsoluble wants to merge 6 commits intomainfrom
fix/update-stores-branch-existence-check

Conversation

@spbsoluble
Copy link
Copy Markdown
Collaborator

@spbsoluble spbsoluble commented Apr 30, 2026

Summary

  • Fixes non-fast-forward push failure in update-stores.yml when a remote branch already exists but has no open PR
  • Branch existence is now checked via git.getRef instead of inferring it from open PRs
  • HAS_OPEN_PR is tracked as a separate output to control whether a new PR should be opened
  • Adds a daily schedule trigger (midnight UTC) with default inputs all/latest

Root Cause

The Check Open PRs for Existing Branch step used open PR existence as a proxy for branch existence. When a branch existed remotely with no open PR, the workflow chose the create path, checked out main, and tried to push to the existing remote branch — resulting in a non-fast-forward rejection.

Test plan

  • Trigger the workflow manually and confirm it handles an existing all branch without the push error
  • Confirm a PR is created when no open PR exists for the branch
  • Confirm a PR is not duplicated when one already exists

Keyfactor and others added 6 commits October 22, 2025 15:43
…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
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