Skip to content

Commit d22c77f

Browse files
committed
fix(release): rebase appcast commit onto origin/main before pushing
The build takes ~10 minutes. Between checkout (at a tag, so HEAD is detached) and the appcast push, code commits can land on main. The resulting non-fast-forward push fails with exit code 1, breaking the release job every time main is active during a build. Fix: after committing the appcast update, fetch origin/main and rebase onto it before pushing. appcast files are never touched by code commits so the rebase will always be conflict-free, and the push will always be a fast-forward. Applied to both release.yml and nightly-dev.yml.
1 parent a008d2c commit d22c77f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/nightly-dev.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ jobs:
136136
echo "No changes to development appcast files"
137137
else
138138
git commit -m "chore(dev-release): update appcast-dev.xml for v${DEV_VERSION}"
139+
# The build takes time; commits may have landed on main. Fetch and rebase
140+
# so our appcast commit lands on top before pushing.
141+
git fetch origin main
142+
git rebase origin/main
139143
git push origin HEAD:main
140144
fi
141145

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,12 @@ jobs:
121121
echo "No changes to appcast.xml"
122122
else
123123
git commit -m "chore(release): update appcast.xml for v${VERSION}"
124-
# Checkout is triggered by a tag, so HEAD is detached - push explicitly to main
124+
# Checkout is triggered by a tag, so HEAD is detached.
125+
# The build takes ~10 minutes, so commits may have landed on main since
126+
# we checked out. Fetch and rebase so our appcast commit lands on top,
127+
# then push. This is race-condition-proof without force-pushing.
128+
git fetch origin main
129+
git rebase origin/main
125130
git push origin HEAD:main
126131
fi
127132

0 commit comments

Comments
 (0)