marcocesarato / php-conventional-changelog

A PHP tool built to generate a changelog from a project's commit messages and metadata following the conventionalcommits.org and automate versioning with semver.org.
GNU General Public License v3.0
227 stars 32 forks source link

Tag bump after having created a release candidate tag #44

Closed jeremycab closed 1 year ago

jeremycab commented 1 year ago

Hi @marcocesarato ,

thanks for this library :) I noticed a bug when I try to create a "release tag" after having created a "release candidate tag".

Let's suppose a repo with one tag named v1.0.0:

It seems that the library doesn't check if the last tag created is a release candidate or not.

jeremycab commented 1 year ago

I made a PR for this => https://github.com/marcocesarato/php-conventional-changelog/pull/46

marcocesarato commented 1 year ago

Hi, first of all thanks for your contribute and your pull request. The pull request seems good except about the "merged only" feature (#28,#32) and the "prefix" feature that are removed from the code. Technically it is possible to do with --match and --exclude

--match <pattern>
     Only consider tags matching the given glob pattern, excluding
     the "refs/tags/" prefix. If used with --all,   it also considers
     local branches and remote-tracking references matching the pattern,
     excluding respectively "refs/heads/"   and "refs/remotes/" prefix;
     references of other types are never considered. If given multiple
     times, a list of patterns will be accumulated, and tags matching
     any of the patterns will be considered. Use --no-match to clear and
     reset the list of patterns.

--exclude <pattern>
     Do not consider tags   matching the given glob pattern, excluding
     the "refs/tags/" prefix. If used with --all,   it also does not
     consider local branches and remote-tracking references matching the
     pattern, excluding respectively "refs/heads/" and "refs/remotes/"
     prefix; references of other types are never considered. If given
     multiple times, a list of patterns will be accumulated and tags
     matching any   of the patterns will be excluded. When combined with
     --match a tag will be considered when it matches at least one
     --match pattern and does not   match any of the --exclude patterns.
     Use --no-exclude to clear and reset the list   of patterns.

I'll take a look how to port the feature on the pull request when I have a little more time, unfortunately at the moment I am very busy. Another time, thanks for your contribute!

marcocesarato commented 1 year ago

Released on v1.15.2, let me know if everything works fine

boumanb commented 1 year ago

@marcocesarato I was experiencing problems. I've proposed changes in https://github.com/marcocesarato/php-conventional-changelog/pull/49.