Standard-version: How do I insert changelog message into commit message?

Created on 9 Dec 2020  Â·  4Comments  Â·  Source: conventional-changelog/standard-version

When I using standard-version to create a new release, standard-version will auto-create a new commit:

chore(release): 1.0.0-beta.2

How does it create a commit message with Changelog? For example:

chore(release): 1.0.0-beta.2

### Features

* Feature A
* Feature B

### Bug Fixes

- Bug A
- Bug B

Anyone here for help?

question triaged

All 4 comments

Hi @kimnh-0823 – the presence of additional messages in your changelog is dependent on your usage of the Coventional Commits syntax for your commits. To create your example changelog your git log before running standard-version would have to look something like:

commit <HASH> (origin/dev, origin/HEAD, dev)
Author: <Author>
Date:   <Date>

    feat: Feature A

commit <HASH>
Author: <Author>
Date:   <Date>

    fix: Bug B

commit <HASH>
Author: <Author>
Date:   <Date>

    feat: Feature B

commit <HASH>
Author: <Author>
Date:   <Date>

    fix: Bug A

commit <HASH>
Author: <Author>
Date:   <Date>

    chore(release): 1.0.0-beta.1

Hopefully, that answers your question – feel free to follow-up if not!

@jbottigliero Thanks for your support.

Currently, the changelog is already rendered by standard-version and saved into the CHANGELOG.md file successfully.
But I also expect the changelog will be saved in the release's commit message. Not only in the CHANGELOG.md file.

---- Current commit:
chore(release): 1.0.0-beta.1

---- Expect commit:
chore(release): 1.0.0-beta.2

### Features
* Feature A...
* Feature B...

### Bug Fixes
- Bug A...
- Bug B...

I see – sorry for the misunderstanding! This isn't something that is supported at the moment. We allow for altering the formatting for the release commit message (--releaseCommitMessageFormat), but the new version is the only value provided to this template.

As an alternative to the commit message, there are releaser-tools that will include the changelog as part of a tagged release (ie. https://github.com/conventional-changelog/standard-version/releases/tag/v9.0.0).

I'm going to close this issue.  If the releasers wind up not working for you feel free to comment and we can move this to a feature request. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

denouche picture denouche  Â·  6Comments

pdcmoreira picture pdcmoreira  Â·  4Comments

lydemann picture lydemann  Â·  3Comments

jefftienchow picture jefftienchow  Â·  5Comments

gultyaev picture gultyaev  Â·  4Comments