Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support hotfixes ("post-releases") #222

Open
MartinCura opened this issue Aug 22, 2023 · 0 comments
Open

Support hotfixes ("post-releases") #222

MartinCura opened this issue Aug 22, 2023 · 0 comments

Comments

@MartinCura
Copy link

Thank you for this useful tool!

I was wondering if this could support hotfixes in some way. We currently have the following as part of our CI release pipeline:

      # On branch `main`, bump according to commit message
      - name: Bump version, commit, tag (according to commit message)
        if: "${{ github.ref_name == 'main' }}"
        uses: phips28/[email protected]
        with:
          tag-prefix: "v"
          minor-wording: "add,Adds,new,minor,feat"
          # patch-wording: "fix,patch,bug"
          # Beginning with 'ci:' will prevent infinite loop
          commit-message: "ci: Release {{version}}\n\n${{ steps.changelog.outputs.changelog }}"
          skip-push: "true"

      # On special branch `deploy_hotfix`, bump hotfix version
      - name: Bump version, commit, tag (for hotfix)
        if: "${{ github.ref_name == 'deploy_hotfix' }}"
        uses: phips28/[email protected]
        with:
          tag-prefix: "v"
          version-type: "prerelease"
          preid: "hotfix"
          # Beginning with 'ci:' will prevent infinite loop
          commit-message: "ci: Release hotfix {{version}}"
          skip-push: "true"

This does mostly what we want, but the patch is bumped too because the hotfix is actually treated as a pre-release of the next patch version.

Ideally we could have one of the following:

  • v1.2.3 is bumped to v1.2.3-hotfix.0, or
  • v1.2.3 is bumped to v1.2.3.1, or something else similar to this.

Is there a way we could achieve something closer to this?

Semver itself doesn't seem to support this kind of branching off for "special" releases, but there's several discussions on it, such as semver/semver#241, and i feel it's something kind of lacking in the spec.

As i'm writing this maybe this is an issue for https://github.com/npm/node-semver 🤔

Lastly, another way of doing it is just bumping the version ourselves and maybe use this Action only for the other actions. How could we skip the automatic bump in this case, but still get the tag and release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant