@@ -11,12 +11,12 @@ const readExistingChangelog = require("./read-existing-changelog");
1111
1212module . exports = updateChangelog ;
1313
14- function updateChangelog ( pkg , type , { changelogPreset, rootPath, tagPrefix, version } ) {
14+ function updateChangelog ( pkg , type , { changelogPreset, rootPath, tagPrefix = "v" , version } ) {
1515 log . silly ( type , "for %s at %s" , pkg . name , pkg . location ) ;
1616
1717 return getChangelogConfig ( changelogPreset , rootPath ) . then ( config => {
1818 const options = { } ;
19- let context ; // pass as positional because cc-core's merge-config is wack
19+ const context = { } ; // pass as positional because cc-core's merge-config is wack
2020
2121 // cc-core mutates input :P
2222 if ( config . conventionalChangelog ) {
@@ -31,7 +31,10 @@ function updateChangelog(pkg, type, { changelogPreset, rootPath, tagPrefix, vers
3131 const gitRawCommitsOpts = Object . assign ( { } , options . config . gitRawCommitsOpts ) ;
3232
3333 if ( type === "root" ) {
34- context = { version } ;
34+ context . version = version ;
35+
36+ // preserve tagPrefix because cc-core can't find the currentTag otherwise
37+ context . currentTag = `${ tagPrefix } ${ version } ` ;
3538
3639 // root changelogs are only enabled in fixed mode, and need the proper tag prefix
3740 options . tagPrefix = tagPrefix ;
@@ -45,6 +48,9 @@ function updateChangelog(pkg, type, { changelogPreset, rootPath, tagPrefix, vers
4548 } else {
4649 // only fixed mode can have a custom tag prefix
4750 options . tagPrefix = tagPrefix ;
51+
52+ // preserve tagPrefix because cc-core can't find the currentTag otherwise
53+ context . currentTag = `${ tagPrefix } ${ pkg . version } ` ;
4854 }
4955 }
5056
0 commit comments