Skip to content

fix: checkout main branch in publish-release to fix detached HEAD push failure#57

Merged
scotwells merged 1 commit intomainfrom
fix/publish-release-detached-head
Mar 12, 2026
Merged

fix: checkout main branch in publish-release to fix detached HEAD push failure#57
scotwells merged 1 commit intomainfrom
fix/publish-release-detached-head

Conversation

@scotwells
Copy link
Contributor

Summary

  • The publish-release job was failing when triggered by a release event because GitHub Actions checks out the tagged commit instead of the main branch, leaving git in a state where it can't push back to main.
  • Adding ref: main to the Checkout step tells the runner to always check out the main branch, so the version bump commit and tag push succeeds.
  • The changes and publish-dev jobs are unchanged — this fix only applies to publish-release.

Test plan

  • Trigger the workflow with release-mode: release and confirm the version bump is pushed to main without errors.
  • Confirm the changes and publish-dev jobs continue to work as expected.

Generated with Claude Code

…ush failure

When triggered by a release event, the default checkout lands on the
tagged commit in detached HEAD state. This causes the version bump push
to fail because git cannot resolve the main branch reference.

Explicitly checking out main in the publish-release job ensures the push
succeeds. The changes and publish-dev jobs are not affected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@scotwells scotwells merged commit b19cf09 into main Mar 12, 2026
3 checks passed
@scotwells scotwells deleted the fix/publish-release-detached-head branch March 12, 2026 11:37
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.

2 participants