Visitar URL original
Allow for "tag already exists" in cz bump github action · Issue #89 · commitizen-tools/commitizen-action · GitHub
Skip to content

Allow for "tag already exists" in cz bump github action #89

Description

@itsthatriver

I have commitizen-tools/commitizen-action@0.21.0 in my workflow running cz bump, but as I've been working on getting it set up properly, I've run into an issue where if it fails and I need to re-run the workflow it's guaranteed to fail on retry because cz bump fails if the target tag already exists.

Commitizen version: 3.30.0
cz --no-raise 21 bump --yes --changelog --check-consistency
bump: version 0.3.0 → 0.4.0
tag to create: 0.4.0
increment detected: MINOR

[main 216[83](https://github.com/ascend-io/gitops-glue/actions/runs/11524448035/job/32084730449#step:6:84)1d] bump: version 0.3.0 → 0.4.0
 2 files changed, 7 insertions(+), 1 deletion(-)

fatal: tag '0.4.0' already exists

I would like for an option to just continue if the target tag already exists. I'm looking at ignoring raise on exit code 7 for BumpTagFailedError, but I suspect that includes failure scenarios that I would not want to ignore where the tag bump really just failed.

Activity

  1. bearomorphism commented on May 10, 2026

    @bearomorphism

    Triage: feature request — add an option to continue when the target tag already exists (re-run safety).

    Out of scope for the bug/doc sweep I'm doing today, leaving for maintainer review.

    Until then, the cleanest workaround is a guard on the workflow itself so the bump job is skipped when the tag already exists:

    - name: Check if version already tagged
      id: tagcheck
      run: |
        git fetch --tags
        if git rev-parse "refs/tags/$NEXT_VERSION" >/dev/null 2>&1; then
          echo "skip=true" >> $GITHUB_OUTPUT
        fi
    - if: steps.tagcheck.outputs.skip != 'true'
      uses: commitizen-tools/commitizen-action@master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions