caarlos0 / svu

Semantic Version Util
MIT License
522 stars 44 forks source link

Option to ignore merge commits #155

Open DP19 opened 2 months ago

DP19 commented 2 months ago

We just added svu / goreleaer to one of our repos and it didn't quite work as i would have expected it to.

Previous tag v1.0.3

I made a branch (goreleaser-prerelease) that tagged commits with a prerelease tag via: svu prerelease --pre-release ${branch} --build ${ci_build_num}

Since the commits here were feat!: this was producing tags like

v2.0.0-goreleaser-prerelease.0+3396

Everything is great up to this point πŸ‘πŸ»

However once this branch merged back to master, the next tag was producing 2.1.0 instead of the expected v2.0.0 with just the prereleae options removed.

It seems like since we have an external bot merging commits with messages like

Merge pull request $PR-LINK from repo/branch
feat: add goreleaser for po

which include the pr title

svu was using the current tag as the prerelease tag v2.0.0-goreleaser-prerelease.0+3396 then bumping the Minor due to this message.

I saw another issue mentioning a no-prerelease flag that isn't supported anymore and links to other options but I don't think it would have fixed this issue, since this would have also just added on more to the --pre-release / --build options or forced a Minor bump which was happening anyway. Is there anyway to add in a ignore-merge-commits option since the default is just to use the commit as the pr title this seems like it will continue to happen if the branch being merged in had a prerelease.

caarlos0 commented 2 months ago

hmmm.. that shouldn't be the case... I believe svu only looks at the first line of the commit message, and the regexes match the beginning of the line only.

this looks more like it should have ignored the prerelease version, but didn't πŸ€”

will take a look!