ietf-tools / semver-action

GitHub Action to calculate the next release version based on conventional commits
BSD 3-Clause "New" or "Revised" License
56 stars 22 forks source link

Feature Request: add a prefix option #27

Closed anden-dev closed 1 year ago

anden-dev commented 1 year ago

Hi,

I use this action and love it, great work.

I would like to propose adding a prefix option to support semver tags with a prefix.

Example workflow for a tag reloader

    - name: 'Get Previous Tag'
        id: previoustag
        uses: "WyriHaximus/github-action-get-previous-tag@v1"
        with:
          fallback: NA
          prefix: reloader/
     - name: 'Get Next Tag'
        id: nexttag
        uses: "ietf-tools/semver-action@v1"
        with:
          branch: master
          noVersionBumpBehavior: warn
          prefix: reloader/

Get Previous Tag reloader/v0.1.0 Get Next Tag reloader/v0.2.0

This would allow the use of this action in monorepos.

Currently, the action does not support prefixed tags

    - name: Get Next Version
        id: semvers
        uses: "ietf-tools/semver-action@v1"
        with:
          branch: master
          noVersionBumpBehavior: warn

so for reloader/v0.1.0 you will receive:

Error: Latest tag is invalid (does not conform to semver)!

which is to be expected.

Here is also a related discussion: https://github.com/renovatebot/renovate/issues/14546

NGPixel commented 1 year ago

Added in v1.4.0