Skip to content

Commit d1d225c

Browse files
committed
chore(changelog): fix changelog script
There was an issue with the "unreleased" link tag, which had been converted to lowercase by Prettier.
1 parent a26f63b commit d1d225c

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ First release
199199

200200
#
201201

202-
[unreleased]: https://github.com/EndBug/add-and-commit/compare/v5.3.0...HEAD
202+
[unreleased]: https://github.com/EndBug/add-and-commit/compare/v6.1.0...HEAD
203203
[1.0.0]: https://github.com/EndBug/add-and-commit/tree/v1.0.0
204204
[2.0.0]: https://github.com/EndBug/add-and-commit/compare/v1.0.0...v2.0.0
205205
[2.1.0]: https://github.com/EndBug/add-and-commit/compare/v2.0.0...v2.1.0

scripts/changelog.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@ arr[1] =
2727
futureChangelog = arr.join('## [Unreleased]')
2828

2929
// Update footer
30-
arr = futureChangelog
31-
.split('\n')
32-
.map((line) =>
33-
line.startsWith('[Unreleased]')
34-
? `[Unreleased]: https://github.com/EndBug/add-and-commit/compare/v${currentVersion}...HEAD`
35-
: line
36-
)
30+
arr = futureChangelog.split('\n').map((line) =>
31+
line.startsWith('[unreleased]') // The link ref is lowercase because of prettier
32+
? `[unreleased]: https://github.com/EndBug/add-and-commit/compare/v${currentVersion}...HEAD`
33+
: line
34+
)
3735

3836
const lastVersion = ([...arr].reverse()[1]?.match(/\[([^\][]*)]/) ||
3937
[])[0].replace(/[\[\]']+/g, '') // eslint-disable-line no-useless-escape

0 commit comments

Comments
 (0)