Repository navigation
ci(release): treat no commits since the tag as nothing to release - #41
Merged
Merged
Conversation
Running Release twice in a row (HEAD is already the tag commit) made commitizen exit 3 (NO_COMMITS_FOUND), which the action's default no_raise of 21 does not cover, so the bump job failed instead of ending with "Nothing to release". Whitelist 3 as well as 21 and say so in the summary text. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJdTaQX9f79fBVtRXhPJQ7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The "Nothing to release" check ended in an error (Release run #2, https://github.com/chezhj/simflow/actions/runs/38303660881). The failing step was
Commitizen bump; its log:HEAD was the bump commit that carries the
v2.10.3tag, so there were no commits at all since the last tag. commitizen reports that asNO_COMMITS_FOUND(exit 3), which is different fromNO_COMMITS_TO_BUMP(exit 21: commits exist but none is bumpable). The action'sno_raisedefaults to21only, so exit 3 failed the job.This was a gap in my earlier testing: I tried only the "docs commit since the tag" case (21), and the weekmenu reference only covered that one too. Running Release twice in a row is the more likely real-world way to hit "nothing to release".
Fix
release.yml:no_raise: "3,21"on thecommitizen-actionstep (the input is comma-delimited; I readaction.ymlandentrypoint.shat 0.27.1). With a no-raise codeczexits 0, so the action carries on andversionequalsprevious_version, which the existing "Evaluate result" step already turns intobumped=false, a notice and the "Nothing to release" summary, anddeployis skipped.No other file changes, no version bump (
ci(release)).Evidence (local; the action itself only runs on GitHub)
The exact invocation the action builds,
cz --no-raise 3,21 bump --yes --changelog, in three clones atv2.10.3:--no-raise 21)NO_COMMITS_FOUND, nothing createddocs:commit since the tagNO_COMMITS_TO_BUMP, nothing createdfix(x):commit since the tagv2.10.4The "Evaluate result" script, extracted from the YAML and run with the env the action would give it: equal versions →
bumped=falseplus the new "Nothing to release" notice/summary;2.10.3→2.10.4→bumped=true version=2.10.4 tag=v2.10.4.release.ymlparses with a singleon:key.cz checkpasses on the commit message and this title, and thepr-titlestyle rules printOK.Not verified
On GitHub: that the action, with
czexiting 0 on a no-raise code, setsversionequal toprevious_versionand pushes nothing in this case. That is read fromentrypoint.sh(versionis set after the bump when the exit is 0) and matches how the exit-21 case behaved in the reference, but only a run proves it. After merging, run Release again withincrement: auto; HEAD will be this PR's squash commit (aci:commit, so case B) and should end with "Nothing to release". To also exercise case A, run it once more after a bump.🤖 Generated with Claude Code
https://claude.ai/code/session_01YJdTaQX9f79fBVtRXhPJQ7
Generated by Claude Code