Skip to content

Cannot create release version after creating a pre-release version #1068

Open

Description

@ahmadgbg

Description

Hi,
I am pretty new when it comes to using Commitizen and have not been able to solve this issue:

Commitizen verison: 3.21.2
Version provider: poetry

When merging a pull request in Github, I have a workflow that automatically creates a pre-release using cz bump --prerelease alpha.
This is being created perfectly but after test that and checking that everything works fine, I have a manual flow that I can trigger to create a Release. This release flow will run cz bump. This fails with the message: No commits found.

I have tried adding cz -nr 3 bump with no success (same results).

Not sure but it seems like the pre-release is noticing a new feature change and bumping the version. After that a new commit with the alpha version bump is creating in main which makes the release version not noticing the feature commit?

Is there a way to release (bump) after doing a pre-release without need a new commit?

Steps to reproduce

  1. Push a PR with feat in title.
  2. Merge PR and GitHub workflow will create a pre-release version (using cz bump -prerelease alpha)
  3. Manually trigger a workflow with release version (using cz bump)

Current behavior

When bumping to the release version, error message is shown: No commits found

Desired behavior

A release version should be able to be created after pre-release version

Screenshots

No response

Environment

  • commitizen: 3.21.2
  • python: 3.10.5

Activity

  1. Lee-W commented on May 20, 2024

    @Lee-W
    Member

    As this issue is mentioned in #1073 , I'll mark it as wait-for-implement and feature, maybe? @noirbizarre Please let me know if I misunderstood anything 🤔

  2. added
    type: feature
    issue-status: wait-for-implementation
    and removed on May 20, 2024
  3. giuseppeambrosio97 commented on Aug 18, 2025

    @giuseppeambrosio97

    I have the same issue.

    I am trying to implement the following releasing workflow:

    • on new commit on main a new pre release rc is created
    • on manual trigger a new non pre release version is created

    But when I run the manual trigger I have the error "No commits found".

    Pre release workflow

    name: Pre-release
    
    on:
      push:
        branches:
          - main
    
    jobs:
      pre-release:
        if: ${{ !startsWith(github.event.head_commit.message, 'bump:') }}
        runs-on: ubuntu-22.04
        permissions:
          contents: write
        steps:
          - name: Checkout
            uses: actions/checkout@v4
            with:
              fetch-depth: 0
          - name: Create bump and changelog
            id: cz-bump
            uses: commitizen-tools/commitizen-action@master
            with:
              github_token: ${{ secrets.GITHUB_TOKEN }}
              changelog_increment_filename: body.md
              prerelease: rc
          - name: Pre-release
            uses: softprops/action-gh-release@v1
            with:
              body_path: body.md
              tag_name: v${{ steps.cz-bump.outputs.version }}
              prerelease: true
            env:
              GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

    Release

    name: Release
    
    on:
      workflow_dispatch:
    
    jobs:
      release:
        runs-on: ubuntu-22.04
        permissions:
          contents: write
        steps:
          - name: Checkout
            uses: actions/checkout@v4
            with:
              fetch-depth: 0
          - name: Create bump and changelog
            id: cz-bump
            uses: commitizen-tools/commitizen-action@master
            with:
              github_token: ${{ secrets.GITHUB_TOKEN }}
              changelog_increment_filename: body.md
          - name: Release
            uses: softprops/action-gh-release@v1
            with:
              body_path: body.md
              tag_name: v${{ steps.cz-bump.outputs.version }}
            env:
              GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

    Configuration

    [tool.commitizen]
    name = "cz_conventional_commits"
    tag_format = "v$version"
    version_scheme = "pep440"
    version_provider = "uv"
    update_changelog_on_bump = true
    major_version_zero = true
    changelog_merge_prerelease = true

    System info

    >>  cz version -r    
    Commitizen Version: 4.8.3
    Python Version: 3.12.8 (main, Jan  5 2025, 05:33:15) [Clang 19.1.6 ]
    Operating System: Linux
  4. tekeinhor commented on Sep 2, 2025

    @tekeinhor

    Hello,

    The reason why doing a release just after a prerelease doesn't work is because of the absence of new commit.

    A new --allow-no-commit flag has been introduced to deal with bumping without commit message in v4.2.0 (it was actually introduced in v4.1.0 under the name --emptyand renamed afterwards) .
    However the No commits found still get raised. Why? Because when you use cz bump, a bunch of things is done but mainly:

    • determine the next version
    • create commit and tag accordingly
    • and eventually update changelog

    The changelog command run during this process raises the NoCommitsFoundError. The --allow-no-commit flag has no effect on it.

    # command/changelog.py L226 'v4.8.3'
            if not commits and (
                self.current_version is None or not self.current_version.is_prerelease
            ):
                raise NoCommitsFoundError("No commits found")

    To fix that, I guess a there are a couple of possibilities.

    • Add the --allow-no-commit flag to the changelog
    • Fix why the self.current_version is empty
      What do you guys think?

    My config

    [tool.commitizen]
    name = "cz_conventional_commits"
    tag_format = "v$major.$minor.$patch$prerelease"
    version_scheme = "semver"
    version_provider = "uv"
    update_changelog_on_bump = true
    major_version_zero = false
  5. fellnerse commented on Jan 22, 2026

    @fellnerse

    We have the exact same problem. What is the expected process for bumping the version after a pre-release?

  6. woile commented on Jan 22, 2026

    @woile
    Member

    This behavior works in v2.41.0. There was probably a regression somewhere

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

    issue-status: wait-for-implementationtype: feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions