You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a workflow where I'm relying solely on the git history for version updates (no file changes).
You can turn off any file updates or other git changes by writing:
cz --no-raise 21 bump --yes --changelog --files-only
bump: version 0.0.0 → 0.1.0
tag to create: 0.1.0
increment detected: MINOR
Repository: someorg/somerepo
Actor: clockwork-muse
Not pushing
Done.
Unfortunately, this doesn't update outputs.version, leaving it at the previous version (0.0.0). This means I have to set commit: true, which disturbs the in-runner git state, which slightly complicates creation of releases (although in all honesty I probably should have done that anyways...).
I can reproduce this also. I suspect this is because when nothing is committed, the bump is detected correctly (for example 0.0.0 -> 0.1.0 in my test repo) but then the version comes from cz version --project which still returns 0.0.0 because the commit doesn't exist and nothing exists in the repo to refer to that version bump.
I can see a couple of potential fixes for this:
when commit: false use the --get-next functionality, which reduces the output from cz bump into a short string which is suitable for consumption in a variable
$ cz bump --yes --files-only
bump: version 0.0.0 → 0.1.0
tag to create: 0.1.0
increment detected: MINOR
vs
$ cz bump --yes --files-only --get-next
0.1.0
do something with post_bump_hooks and the CZ_POST_ environment variables which appear to be set by Commitizen regardless of the outputs, and unlike calling a new cz version --project command should use the correct version as correctly determined by cz bump
for example a post_bump_hook of echo "version=${CZ_POST_CURRENT_VERSION}" >>"$GITHUB_OUTPUT"
I'm looking to build a workflow where commits to main are forbidden by company policy - so all I need Commitizen to do is use conventional commits to determine what the next version should be based on the contents/scope, and then tell me what the tag would be so that I can then use a second GitHub Action to create a GitHub release (including a Git tag, and changelogs as part of the release and not a CHANGELOG file in a commit). I'm keen to see how this could be fixed because apart from this bug Commitizen does seem to be able to do what I need.
For the folk still having this issue, I'm curious whether changing the reference to g-a-c/commitizen-action@feature/commit-false-fix works for you? I've used this fork and I've successfully run this against a Git repo with zero existing tags and found that both the "bump" from 0.0.0 -> 0.1.0 is detected successfully and also the tag gets created correctly as 0.1.0
PREV_REV=0.0.0
bump: version 0.0.0 → 0.1.0
tag to create: 0.1.0
increment detected: MINOR
Post-bump: cz version --project = '0.0.0'
=== outputs ===
version=0.0.0
next_version_major=0
next_version_minor=0
Cause: outputs.version is sourced from cz version --projectafter the bump. With version_provider=""scm"" + commit:false, the bump does not update any tracked file and does not create a tag, so cz version --project keeps reporting the old version.
Fix in #114: capture the would-be next version with cz bump --get-nextbefore the real bump (a pure computation, no state change), and use it as a fallback when cz version --project still reports the previous version after the bump. Major/minor are derived from the same captured string so they stay consistent. The fallback is skipped when --get-next itself fails (e.g. no bumpable commits), preserving today's behaviour.
Activity
woile commentedon Dec 21, 2024
Is that how you access
outputs.version? Looking at the script, the version is inserted even withpush: false, commit:false, so it should work.Clockwork-Muse commentedon Dec 23, 2024
With the following workflow:
The job output shows the following environment variable/output (truncated for brevity):
Additionally, the
releasejob is skipped.The generated changelog does show the bump, but none of the outputs reflect that:
Cynocracy commentedon Jan 22, 2025
I can reproduce this, unable to use commitizen-action to bump the semver without commit: true
g-a-c commentedon Feb 3, 2025
I can reproduce this also. I suspect this is because when nothing is committed, the bump is detected correctly (for example
0.0.0 -> 0.1.0in my test repo) but then the version comes fromcz version --projectwhich still returns0.0.0because the commit doesn't exist and nothing exists in the repo to refer to that version bump.I can see a couple of potential fixes for this:
commit: falseuse the--get-nextfunctionality, which reduces the output fromcz bumpinto a short string which is suitable for consumption in a variablepost_bump_hooksand theCZ_POST_environment variables which appear to be set by Commitizen regardless of the outputs, and unlike calling a newcz version --projectcommand should use the correct version as correctly determined bycz bumppost_bump_hookofecho "version=${CZ_POST_CURRENT_VERSION}" >>"$GITHUB_OUTPUT"I'm looking to build a workflow where commits to
mainare forbidden by company policy - so all I need Commitizen to do is use conventional commits to determine what the next version should be based on the contents/scope, and then tell me what the tag would be so that I can then use a second GitHub Action to create a GitHub release (including a Git tag, and changelogs as part of the release and not aCHANGELOGfile in a commit). I'm keen to see how this could be fixed because apart from this bug Commitizen does seem to be able to do what I need.g-a-c commentedon Feb 3, 2025
For the folk still having this issue, I'm curious whether changing the reference to
g-a-c/commitizen-action@feature/commit-false-fixworks for you? I've used this fork and I've successfully run this against a Git repo with zero existing tags and found that both the "bump" from0.0.0 -> 0.1.0is detected successfully and also the tag gets created correctly as0.1.0bearomorphism commentedon May 10, 2026
Reproduced and fix posted as #114.
Repro (fresh repo, one
feat:commit,version_provider = ""scm"",commit: false):Cause:
outputs.versionis sourced fromcz version --projectafter the bump. Withversion_provider=""scm""+commit:false, the bump does not update any tracked file and does not create a tag, socz version --projectkeeps reporting the old version.Fix in #114: capture the would-be next version with
cz bump --get-nextbefore the real bump (a pure computation, no state change), and use it as a fallback whencz version --projectstill reports the previous version after the bump. Major/minor are derived from the same captured string so they stay consistent. The fallback is skipped when--get-nextitself fails (e.g. no bumpable commits), preserving today's behaviour.After fix:
fix: report new version when commit is false and no version files update