Skip to content

Commit 351d5e7

Browse files
fix: handle detached HEAD in release workflow
The release workflow was in detached HEAD state when checking out tags, causing push failures. Now explicitly checks out main branch and pulls before committing submodule updates. This fixes the "non-fast-forward" error in the release automation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 111c641 commit 351d5e7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ jobs:
117117
if git diff --quiet Formula/axon.rb; then
118118
echo "No changes to formula"
119119
else
120+
# Ensure we're on main branch in submodule
121+
git checkout main
122+
git pull origin main
120123
git add Formula/axon.rb
121124
git commit -m "Update AXON formula for ${TAG_NAME}"
122125
git push origin main
@@ -125,13 +128,17 @@ jobs:
125128
126129
# Update submodule reference in main repo
127130
cd ..
131+
132+
# Ensure we're on main branch
133+
git checkout main
134+
git pull origin main
128135
git add homebrew-tap
129136
130137
if git diff --staged --quiet; then
131138
echo "No submodule changes to commit"
132139
else
133140
git commit -m "Update homebrew-tap submodule for ${TAG_NAME}"
134-
git push origin HEAD:main
141+
git push origin main
135142
echo "✓ Updated submodule reference in main repo"
136143
fi
137144

0 commit comments

Comments
 (0)