Skip to content

fix(bump): add changelog file into stage when running `cz bump --changelog #228

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

Merged
merged 1 commit into from
Jul 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions commitizen/commands/bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import questionary
from packaging.version import Version

from commitizen import bump, factory, git, out
from commitizen import bump, cmd, factory, git, out
from commitizen.commands.changelog import Changelog
from commitizen.config import BaseConfig
from commitizen.exceptions import (
Expand Down Expand Up @@ -142,15 +142,16 @@ def __call__(self): # noqa: C901
raise ExpectedExit()

if self.changelog:
changelog = Changelog(
changelog_cmd = Changelog(
self.config,
{
"unreleased_version": new_tag_version,
"incremental": True,
"dry_run": dry_run,
},
)
changelog()
changelog_cmd()
c = cmd.run(f"git add {changelog_cmd.file_name}")

self.config.set_key("version", new_version.public)
c = git.commit(message, args=self._get_commit_args())
Expand Down