mikepenz / release-changelog-builder-action

A GitHub action that builds your release notes / changelog fast, easy and exactly the way you want.
https://blog.mikepenz.dev
Apache License 2.0
703 stars 104 forks source link

can wildcards be used in FromTag ? #1315

Closed xpillons closed 6 months ago

xpillons commented 7 months ago

I need to managed two set of tagging versions in my repo, but only considering building the changelog for one set. first set of tags will be v1.0.x, second set of tags will be w1.0.x, and both tag set would overlap.

In order to build the changelog only for tags v1.0.x can I use a wildcard in the FromTag ?

If not how could I proceed ? Thank you

mikepenz commented 7 months ago

@xpillons it depends on the exact scenario. However there are multiple routes possible.

The best way for resolving only tags matching the w prefix, is to define a tag_resolver as part of your config

"tag_resolver": {
      "method": "semver",
      "filter": {
        "pattern": "v(.+)",
        "flags": "gu"
      }
    },

This one would then make sure only the respective fromTag is used. Alternative you can also just pass in from and to directly.

As I assume both tags exist on the same branch structure, keep in mind that your PRs also will need some identification to be filtered out accordingly. As they are practically part of either tag.

xpillons commented 7 months ago

Thanks for the quick answer, I will use your resolver. And yes I will use different tags for identifying the PRs

mikepenz commented 7 months ago

Something like:

{
  "tag_resolver": {
    "method": "semver",
    "filter": {
      "pattern": "v(.+)",
      "flags": "gu"
    },
    "transformer": {
      "pattern": "v(.+)",
      "target": "$1"
    }
  }
}

may do the job for you. (if you only ever care about the v releases)

mikepenz commented 6 months ago

Please report back if the answer helped, closing in the meantime

xpillons commented 6 months ago

yes it help. I applied the filter pattern. Apologize for the late answer.