Skip to content

Commit f5c1a3f

Browse files
TMHSDigitalclaude
andcommitted
ci: fail the release when the bump push is rejected and main has not moved
Any push failure was reported as 'main moved' and exited green with stale=true, so a ruleset, token or network failure skipped tag, release, plugin-dist and Pages on every run without a red signal. After a failed push the job now re-fetches main: it stands down only if origin/main advanced past the commit it checked out, and otherwise fails with an error. Closes #516 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LpkeXRvikhJZSVGBFM91Dv Signed-off-by: TM Hospitality Strategies <TMHospitalityStrategies@gmail.com>
1 parent 1998aeb commit f5c1a3f

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,17 @@ jobs:
266266
else
267267
git commit -s -m "chore: bump version to ${{ steps.new.outputs.version }} [skip ci]"
268268
if ! git push origin main; then
269-
echo "::notice::push rejected (main moved); the newer release run will publish this range"
270-
echo "stale=true" >> "$GITHUB_OUTPUT"
271-
exit 0
269+
# Stand down only when main really moved. Any other rejection
270+
# (ruleset, token, permissions, network) must fail loudly, or
271+
# every release stalls behind a green run (#516).
272+
git fetch -q origin main || true
273+
if [ "$(git rev-parse origin/main)" != "$(git rev-parse HEAD~1)" ]; then
274+
echo "::notice::push rejected (main moved); the newer release run will publish this range"
275+
echo "stale=true" >> "$GITHUB_OUTPUT"
276+
exit 0
277+
fi
278+
echo "::error::git push of the version bump failed and origin/main has not moved; check the token, rulesets and branch protection"
279+
exit 1
272280
fi
273281
fi
274282

0 commit comments

Comments
 (0)