Skip to content

Commit

Permalink
Fix ${npm.name} not interpolating in tagPrefix
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanrastrick committed Apr 23, 2024
1 parent 2002150 commit bc8bb2d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@ class ConventionalChangelog extends Plugin {
const { options } = this;
this.debug({ increment, latestVersion, isPreRelease, preReleaseId });
this.debug('conventionalRecommendedBump', { options });
let { tagPrefix } = options
const npmName = this.config.getContext('npm.name')
if (tagPrefix && npmName) {
tagPrefix = tagPrefix.replace(/\$\{npm\.name\}/, npmName)
}
const updatedOptions = { ...options, tagPrefix }
try {
const result = await conventionalRecommendedBump(options, options?.parserOpts);
const result = await conventionalRecommendedBump(updatedOptions, options?.parserOpts);
this.debug({ result });
let { releaseType } = result;
if (increment) {
Expand Down

0 comments on commit bc8bb2d

Please sign in to comment.