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 custom strings to the semver calculation #19

Closed vyas-n closed 1 year ago

vyas-n commented 2 years ago

Hello,

Thanks for the cool GitHub Action. I'm currently using this to tag repositories automatically and was wondering if there could be a feature to add a custom commit message into the SemVer calculation.

I'd like to calculate the next expected SemVer for a PR based on the PR title when I squash-merge the PR into the main branch. This is so that I can enforce that the tag version in the manifests are updated correctly before merging the PR.

Examples:

- name: Get Next Semantic Version
  id: semver
  uses: ietf-tools/semver-action@v1
    token: ${{ github.token }}
    branch: main
    additionalCommits:
      - "ci: add something to ci"
- name: Check if tag matches version in files
  run: |
    [[ $(yq e '.version' Chart.yaml) == "${{ steps.semver.outputs.nextStrict }}" ]]
    [[ $(yq e '.appVersion' Chart.yaml) == "${{ steps.semver.outputs.nextStrict }}" ]]
- name: Get Next Semantic Version
  id: semver
  uses: ietf-tools/semver-action@v1
    token: ${{ github.token }}
    branch: main
    additionalCommits:
      - ${{ github.event.pull_request.title }}
- name: Check if tag matches version in files
  run: |
    [[ $(yq e '.version' Chart.yaml) == "${{ steps.semver.outputs.nextStrict }}" ]]
    [[ $(yq e '.appVersion' Chart.yaml) == "${{ steps.semver.outputs.nextStrict }}" ]]
NGPixel commented 1 year ago

Added in v.1.4.0.