fix: stop nested push in release hook

This commit is contained in:
2026-04-19 12:07:08 +02:00
parent 9f42c68279
commit 3510474764

View File

@@ -67,7 +67,8 @@ fi
git -C "$ROOT_DIR" add "$ROOT_DIR/version.json" "$ROOT_DIR/iKeyMon.xcodeproj/project.pbxproj" "$ROOT_DIR/Sparkle/appcast.xml" git -C "$ROOT_DIR" add "$ROOT_DIR/version.json" "$ROOT_DIR/iKeyMon.xcodeproj/project.pbxproj" "$ROOT_DIR/Sparkle/appcast.xml"
if git -C "$ROOT_DIR" diff --cached --quiet; then if git -C "$ROOT_DIR" diff --cached --quiet; then
echo "release: no changes detected; skipping commit" echo "release: no changes detected; continuing push"
exit 0
else else
run_logged git -C "$ROOT_DIR" commit -m "chore: release ${NEW_VERSION}" || { run_logged git -C "$ROOT_DIR" commit -m "chore: release ${NEW_VERSION}" || {
echo "release: commit failed (log: $RELEASE_LOG)" echo "release: commit failed (log: $RELEASE_LOG)"
@@ -75,10 +76,5 @@ else
} }
fi fi
if SKIP_RELEASE=1 git -C "$ROOT_DIR" push --quiet "$REMOTE_NAME" "${release_local_ref:-refs/heads/master}:${release_remote_ref:-refs/heads/master}"; then echo "release: created commit for v${NEW_VERSION}; run 'git push' again to push the new release commit"
echo "release: success v${NEW_VERSION} (release commit already pushed; stopping original push)" exit 1
exit 1
else
echo "release: push failed (log: $RELEASE_LOG)"
exit 1
fi