Skip to content

Commit 3fe1da7

Browse files
fix(release): skip branch push for pre-releases to avoid branch protection (gptme#1548)
Fix for scheduled release CI failure: pre-release branch push now skipped to avoid branch protection rules.
1 parent 46a6de6 commit 3fe1da7

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

scripts/publish_release.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,24 @@ echo "Publishing release: ${TAG} (pre-release=${PRERELEASE})"
7171

7272
echo "Pushing ${TAG} to origin..."
7373
if [ "$DRY_RUN" = "false" ]; then
74-
git push origin HEAD:master
74+
if [ "$PRERELEASE" = "false" ]; then
75+
# Stable releases: push version bump commit to master.
76+
# Requires the user/bot to have branch protection bypass rights.
77+
git push origin HEAD:master
78+
else
79+
# Pre-releases: skip the branch push entirely.
80+
# The tag push (below) will carry the version-bump commit to GitHub
81+
# as an unreachable-from-branch object — that's fine for dev builds.
82+
# This avoids hitting branch protection rules in CI.
83+
echo " Skipping branch push for pre-release (branch protection safe)."
84+
fi
7585
git push origin "${TAG}"
7686
else
77-
echo " [dry-run] git push origin HEAD:master"
87+
if [ "$PRERELEASE" = "false" ]; then
88+
echo " [dry-run] git push origin HEAD:master"
89+
else
90+
echo " [dry-run] Skipping branch push for pre-release"
91+
fi
7892
echo " [dry-run] git push origin ${TAG}"
7993
fi
8094

0 commit comments

Comments
 (0)