Skip to content

Git output in the changelog increment file #82

Description

@paduszyk

The action writes the output to the changelog increment file if the changelog_increment_filename input is applied. However, the final file includes the output from Git, e.g. (taken from the latest release):

[master https://github.com/commitizen-tools/commitizen-action/commit/1f11eb222996406681d2bfa1eb3d997eca46557c] bump: version 0.20.0 → 0.21.0
2 files changed, 8 insertions(+), 1 deletion(-)

Is that actually needed? I think having here a link to the previous-current release comparison would be more useful.

I guess this will require some extra processing of the bump output involving removing the last two lines.

Activity

  1. bearomorphism commented on May 10, 2026

    @bearomorphism

    Reproduced and fix posted as #113.

    Repro (fresh repo, one feat: commit, current master): with changelog_increment_filename: increment.md, increment.md ends with the git noise:

    ## 0.1.0 (2026-05-10)
    
    ### Feat
    
    - initial
    
    [main f21d45e] bump: version 0.0.0 → 0.1.0
     2 files changed, 6 insertions(+), 1 deletion(-)
     create mode 100644 CHANGELOG.md
    

    Cause: when changelog_increment_filename is set, the action redirects cz bump stdout to that file. Without --git-output-to-stderr, the post-bump git commit summary is also written there.

    Fix in #113: when changelog_increment_filename is supplied, automatically force --git-output-to-stderr (unless the user already enabled it via git_redirect_stderr: true). The git noise then goes to the action log only, and increment.md contains just the changelog section.

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