conventional-changelog / standard-version

:trophy: Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org
ISC License
7.65k stars 791 forks source link

Generating incorrect version based on previous version commits #716

Open KL13NT opened 3 years ago

KL13NT commented 3 years ago

Describe the bug When running standard-version after committing a bunch of fix commits the package uses old BREAKING commits and produces a new MAJOR version.

Expected behavior It should only bump the PATCH part of the version.

Environment

Additional context I'm using commitizen and commitlint to keep my commits as close to the angular format as possible. Reproducible behavior is available here.

  1. Clone the repo
  2. Run npm install
  3. Run npm run release
  4. Instead of bumping from v2.0.0 to v2.1.0 it bumps to v3.0.0
  5. Run npm run release again
  6. It bumps it up even more to v4.0.0, and so on
KL13NT commented 3 years ago

This seems to be affecting more than just me.

patlux commented 2 years ago

For everyone else with the same issue:

Make sure you have all tags correctly parsed by standard-version (For me the problem was that a team member forgot to push the tag of the previous version)

  1. npm install -g git-semver-tags and run it inside your project to get a list of parsed tags: git-semver-tags
  2. See if the tags are correctly parsed
  3. If not, your team member should push the tags with git push origin --tags
  4. If yes, debug the issue further with npx standard-version --verbose. Maybe it helps.