diff --git a/core/conventional-commits/__tests__/conventional-commits.test.js b/core/conventional-commits/__tests__/conventional-commits.test.js index 2a41808781..0c7cfe669c 100644 --- a/core/conventional-commits/__tests__/conventional-commits.test.js +++ b/core/conventional-commits/__tests__/conventional-commits.test.js @@ -385,7 +385,7 @@ describe("conventional-commits", () => { * A second commit for our CHANGELOG ([SHA](https://github.com/lerna/conventional-commits-fixed/commit/SHA)) `); expect(rootChangelog.newEntry.trimRight()).toMatchInlineSnapshot(` -## 1.0.1 (YYYY-MM-DD) +## [1.0.1](/compare/dragons-are-awesome1.0.0...1.0.1) (YYYY-MM-DD) ### Bug Fixes @@ -409,12 +409,11 @@ describe("conventional-commits", () => { // second commit should not show up again expect(lastRootChangelog.newEntry.trimRight()).toMatchInlineSnapshot(` -## 1.0.2 (YYYY-MM-DD) +## [1.0.2](/compare/dragons-are-awesome1.0.1...1.0.2) (YYYY-MM-DD) ### Bug Fixes -* A second commit for our CHANGELOG ([SHA](https://github.com/lerna/conventional-commits-fixed/commit/SHA)) * A third commit for our CHANGELOG ([SHA](https://github.com/lerna/conventional-commits-fixed/commit/SHA)) `); }); diff --git a/core/conventional-commits/lib/update-changelog.js b/core/conventional-commits/lib/update-changelog.js index a56375a1ad..12a4824280 100644 --- a/core/conventional-commits/lib/update-changelog.js +++ b/core/conventional-commits/lib/update-changelog.js @@ -32,6 +32,9 @@ function updateChangelog(pkg, type, { changelogPreset, rootPath, tagPrefix, vers if (type === "root") { context = { version }; + + // root changelogs are only enabled in fixed mode, and need the proper tag prefix + options.tagPrefix = tagPrefix; } else { // "fixed" or "independent" gitRawCommitsOpts.path = pkg.location;