git-cliff icon indicating copy to clipboard operation
git-cliff copied to clipboard

Rerender a specific tag/unreleased in the changelog

Open ruben-arts opened this issue 2 years ago • 7 comments

Describe the solution you'd like

I would like to use git-cliff in a GitHub action that runs after every merged PR. Updating the [unreleased] section. My initial instinct was that using the --prepend would have this behavior.

Describe alternatives you've considered

I could write some find replace code to manually do the replacement using the output of git-cliff.

Additional context

Example of the wokflow I'm looking for:

# CHANGELOG

## [1.2.3]
- change by @person in #1234
git merge feature/x
git-cliff -u --prepend changelog.md
# CHANGELOG

## [unreleased]
- feature x by @person in #1235

## [1.2.3]
- change by @person in #1234
git merge feature/y
git-cliff -u --prepend changelog.md
# CHANGELOG

## [unreleased]
- feature y by @person in #1236
- feature x by @person in #1235

## [1.2.3]
- change by @person in #1234

ruben-arts avatar Jan 04 '24 15:01 ruben-arts

Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️

welcome[bot] avatar Jan 04 '24 15:01 welcome[bot]

Also reported in #544

orhun avatar Mar 13 '24 18:03 orhun

FWIW we can use the markdown crate for parsing the changelog.

orhun avatar Jun 13 '24 14:06 orhun