fix(bump): pre and post bump hooks were failing when an increment was provided (fix #1004) #1007
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.
Description
Since c245b14,
cz bump
with pre or post hook and a--increment
provided were failing it no tag were existing (cf. #1004).This PR add a test reproducing the issue and fix it.
Checklist
./scripts/format
and./scripts/test
locally to ensure this change passes linter check and testExpected behavior
Run
cz bump --yes --increment PATCH|MINOR|MAJOR
on a repository with either a pre or post hook and without existing version tag, it should not fail.Steps to Test This Pull Request
Run
cz bump --yes --increment PATCH|MINOR|MAJOR
on a repository with either a pre or post hook and without existing version tag, withcommitizen>=3.16
. It should fail without this patch and succeed with (cf. test case)