absolute-version / commit-and-tag-version

Fork of the excellent standard-version. Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org :trophy:
ISC License
385 stars 36 forks source link

Front-matter is removed from CHANGELOG when running commit-and-tag-version #106

Closed TimKnight-DWP closed 10 months ago

TimKnight-DWP commented 10 months ago

Describe the bug When I run npx commit-and-tag-version any front matter on my changelog is removed

My existing changelog has some front matter:

---
status: new
---

# Changelog

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

## [4.13.0](https://gitlab.com/.../compare/4.12.3...4.13.0) (2023-10-18)

### Features

Current behavior

# Changelog

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

## [4.13.2](https://gitlab.com/.../compare/4.13.0...4.13.2) (2023-10-19)

Front matter is removed

Expected behavior Front matter should be maintained, so that we can attach fuller metadata to our changelogs

Environment

Possible Solution

I am unsure where to start looking through the code, I presume it is something in the parse/write process, where the front matter gets stripped off before or after the new commit history is added

TimothyJones commented 10 months ago

Thanks for the report! It’s after midnight where I am, but just a quick note to say that I think the part of the code you’re looking for is in lib/lifecycles/changelog.js

TimKnight-DWP commented 10 months ago

@TimothyJones appreciate the response! but get some sleep 😉

TimKnight-DWP commented 10 months ago

@TimothyJones PR raised, happy to squash prior to merge in https://github.com/absolute-version/commit-and-tag-version/pull/108