commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

feat: enable --prerelease none for CI/CD

Open dmyersturnbull opened this issue 1 year ago • 2 comments

Sorry for not creating an issue first, but I figured the change was so easy to make.

--prerelease none

When using the GitHub Action, users will probably want to set --prerelease either dynamically or from a dispatch parameter. Without this, redundant commitizen-action calls are needed; e.g.:


- id: cz-prerelease
  name: Create bump and changelog (prerelease only)
  if: ${{ github.event.inputs.prerelease }}
  uses: commitizen-tools/commitizen-action@master
  with:
    github_token: ${{ secrets.PAT }}
    git_name: ${{ steps.gpg.outputs.name }}
    git_email: ${{ steps.gpg.outputs.email }}
    gpg_sign: true
    prerelease: ${{ prerelease }}
    debug: true

- id: cz-release
  name: Create bump and changelog (stable release only)
  if: ${{ ! github.event.inputs.prerelease }}
  uses: commitizen-tools/commitizen-action@master
  with:
    github_token: ${{ secrets.PAT }}
    git_name: ${{ steps.gpg.outputs.name }}
    git_email: ${{ steps.gpg.outputs.email }}
    gpg_sign: true
    # no prerelease
    debug: true

StrEnum

While at it, I also converted Increment and Prerelease into StrEnums, which should be helpful in an IDE. I violated the convention of ALL_CAPS for Prerelease for consistency, but I'm happy to change it.

Edit: gh pr create --fill did something weird!

dmyersturnbull avatar Jun 17 '24 14:06 dmyersturnbull

It sounds like a good improvement to me, but we will need your help to get a CI pass before we can do a thoughtful review. Thanks!

Lee-W avatar Jun 27 '24 01:06 Lee-W

Thanks for the reply. I'll get to this! I was just surprised that the tests failed and didn't immediately have time to fix it.

dmyersturnbull avatar Aug 02 '24 20:08 dmyersturnbull