absolute-version / commit-and-tag-version

Fork of the excellent standard-version. Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org :trophy:
ISC License
425 stars 40 forks source link

Why commit-and-tag-version bump version as a new patch without any commit has related type? #203

Closed HosseinSalmanian closed 2 days ago

HosseinSalmanian commented 3 weeks ago

Suppose we have the following git commit tree in our branch.


- style: some styles has changed <= dev
- docs: docs updated
- chore: some routine works
- feat1 <= v1.0.0
- initail 

if we run commit-and-tag-version a new commit and tag will be created and the version will bump to v1.0.1 even there is no fix type commit between tag v1.0.0 and the HEAD.

Why commit-and-tag-version behave like this?

TimothyJones commented 2 weeks ago

Because you asked it to make a release. Without other information it defaults to a patch bump.

HosseinSalmanian commented 2 weeks ago

@TimothyJones Thanks for the response.

Can you provide more details for how can change the default in order to adhering conventional commit ? We want to bump version only base on previous commits ( commits between HEAD and latest tagged version).

TimothyJones commented 2 weeks ago

If you don’t want to make a release, just don’t run the tool.

Reading between the lines- it's not designed to be run in CI on every push. If you’re doing that, you’ll need to build extra tooling.

What I did when I had that use case was to do a dry run, read the changlog out of the output, and skip the release if it was empty.

HosseinSalmanian commented 2 weeks ago

@TimothyJones

Thanks again, We made the release conditionally based on --dry-run output as you suggested.

TimothyJones commented 2 days ago

You're welcome! I'll close this for now, please feel free to re-open if you have any problems.