Fix release-tag workflow for releases created from v* tag on main branch#85
Merged
data-douser merged 1 commit intomainfrom Feb 24, 2026
Merged
Fix release-tag workflow for releases created from v* tag on main branch#85data-douser merged 1 commit intomainfrom
release-tag workflow for releases created from v* tag on main branch#85data-douser merged 1 commit intomainfrom
Conversation
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.
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Contributor
There was a problem hiding this comment.
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/mainusing Git refspec syntax
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 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
mainbranch work reliably in these scenarios.Outline of Changes
Release workflow improvements:
.github/workflows/release-tag.ymlworkflow, the script now creates a temporary local branch (tmp/release-${TAG}) when running in a detached HEAD state to allowgit commitand subsequent push operations to work correctly.refs/heads/mainon the remote, ensuring that version changes are properly committed to themainbranch.