thomaseizinger/keep-a-changelog-new-release

Action doesn't properly handle `prettier` formatted Markdown

Closed this issue · 1 comments

My changelog was roughly

## [Unreleased][unreleased]
Bunch of stuff here
## [0.6.2][] - 2022-08-31
...
[unreleased]: https://github.com/user/repo/compare/0.6.2...HEAD
[0.6.2]: https://github.com/user/repo/compare/0.6.1...0.6.2
...

and after running this action on it, the file was changed to

## [Unreleased]

## [1.0.0] - 2023-09-09
Bunch of stuff here
## [0.6.2][] - 2022-08-31
...
[unreleased]: https://github.com/user/repo/compare/0.6.2...HEAD
[0.6.2]: https://github.com/user/repo/compare/0.6.1...0.6.2
...

[Unreleased]: https://github.com/Questionable-Content-Extensions/client/compare/1.0.0...HEAD

[1.0.0]: https://github.com/user/repo/compare/0.6.2...1.0.0

i.e. the original [unreleased] link was left alone and a new one was created at the end, along with the new one for the new version. The problem is, at least on GitHub, [unreleased] and [Unreleased] are both the same, and my change log's Unreleased heading ended up still linking to the compare/0.6.2...HEAD rather than the new compare/1.0.0...HEAD, presumably because it was earlier in the document.

I think whatever parsing is used in this action needs some robustness added to not make these mistakes.

Thanks for opening the issue!

See #7. Contributions welcome to improve the situation, I don't currently have any plans on working on this actively.