Skip to content

Fix release-tag workflow for releases created from v* tag on main branch#85

Merged
data-douser merged 1 commit intomainfrom
dd/release-prep/4
Feb 24, 2026
Merged

Fix release-tag workflow for releases created from v* tag on main branch#85
data-douser merged 1 commit intomainfrom
dd/release-prep/4

Conversation

@data-douser
Copy link
Copy Markdown
Collaborator

Summary of Changes

This pull request updates the release workflow to handle cases where the workflow is triggered from a tag, which can leave the repository in a detached HEAD state. The changes ensure that commits and pushes to the main branch work reliably in these scenarios.

Outline of Changes

Release workflow improvements:

  • In the .github/workflows/release-tag.yml workflow, the script now creates a temporary local branch (tmp/release-${TAG}) when running in a detached HEAD state to allow git commit and subsequent push operations to work correctly.
  • The workflow now pushes the temporary branch directly to refs/heads/main on the remote, ensuring that version changes are properly committed to the main branch.

The release-tag workflow checks out a commit (not a branch), leaving
git in detached HEAD state.  `git push origin HEAD` fails because git
cannot resolve the bare `HEAD` symbolic ref to a remote branch name.

Create a temporary local branch before committing and use an explicit
refspec (`tmp/release-vX.Y.Z:refs/heads/main`) so the push is an
unambiguous fast-forward to main.
@data-douser data-douser self-assigned this Feb 24, 2026
@data-douser data-douser requested a review from enyil as a code owner February 24, 2026 02:20
Copilot AI review requested due to automatic review settings February 24, 2026 02:20
@data-douser data-douser requested a review from a team as a code owner February 24, 2026 02:20
@data-douser data-douser added the bug Something isn't working label Feb 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@data-douser data-douser merged commit ee8eeb7 into main Feb 24, 2026
9 checks passed
@data-douser data-douser deleted the dd/release-prep/4 branch February 24, 2026 02:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes the release-tag workflow to handle detached HEAD states that occur when the workflow is triggered from a tag reference. The fix ensures that version update commits can be successfully pushed to the main branch even when the repository checkout is in a detached HEAD state.

Changes:

  • Added logic to create a temporary local branch when in detached HEAD state before committing changes
  • Updated the push command to explicitly push the temporary branch to refs/heads/main using Git refspec syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants