Skip to content

fix(ci): repair recurring sync-develop checkout failure#318

Merged
neuromechanist merged 1 commit into
developfrom
fix/sync-develop-checkout
Jun 8, 2026
Merged

fix(ci): repair recurring sync-develop checkout failure#318
neuromechanist merged 1 commit into
developfrom
fix/sync-develop-checkout

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Problem

sync-develop.yml ("Sync develop with main and bump") has failed on every stable release (verified on v0.8.3 and v0.8.4), leaving develop unsynced after each release. It dies at the checkout step:

##[error]A branch or tag with the name 'develop' could not be found

The full log shows the cause: under the workflow_run trigger, actions/checkout's wildcard fetch

git fetch ... origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/*
 * [new branch]      main        -> origin/main
 * [new tag]         v0.8.4 ...

advertises only main among heads. develop is never fetched, so ref: develop can't be resolved. (The token is valid: it authenticates and fetches main + all tags.)

Fix

Check out main (always advertised), then fetch develop by explicit named ref and check it out. A named-ref fetch requests the ref directly and is reliable, unlike the wildcard advertisement.

- name: Checkout main
  uses: actions/checkout@v4
  with:
    ref: main
    fetch-depth: 0
    token: ${{ secrets.CI_ADMIN_TOKEN }}
- name: Check out develop by explicit ref
  run: |
    git fetch origin +refs/heads/develop:refs/remotes/origin/develop
    git checkout -B develop refs/remotes/origin/develop

The remaining steps (validate main version, merge --no-ff origin/main, bump to <next-patch>.dev0, push) are unchanged and operate on the now-checked-out develop.

Verification

YAML validated; step order preserved. The real test is the next stable release: the workflow should merge main into develop and bump automatically, with no manual sync. For v0.8.4 the sync was performed manually (develop is already at 0.8.5.dev0).

The post-release sync failed on every release (through v0.8.4) at the checkout
step: under the workflow_run trigger, actions/checkout's wildcard fetch
(+refs/heads/*) intermittently advertised only main, so ref: develop raised
'a branch or tag with the name develop could not be found'. Check out main
(always advertised) and fetch develop by explicit name, which requests the ref
directly and is reliable.
@neuromechanist neuromechanist merged commit a583149 into develop Jun 8, 2026
6 checks passed
@neuromechanist neuromechanist deleted the fix/sync-develop-checkout branch June 8, 2026 18:44
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