Skip to content

Commit

Permalink
Improve tag version parser
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Aug 11, 2021
1 parent 628edc6 commit 2fc0e94
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/plugin/GitBase.js
Expand Up @@ -22,8 +22,9 @@ class GitBase extends Plugin {
}

getLatestVersion() {
const latestTagName = this.getContext('latestTagName');
return latestTagName ? latestTagName.replace(/^v/, '') : null;
const { tagTemplate, latestTag } = this.config.getContext();
const prefix = tagTemplate.replace(/\$\{version\}/, '');
return latestTag ? latestTag.replace(prefix, '').replace(/^v/, '') : null;
}

async getChangelog() {
Expand Down

0 comments on commit 2fc0e94

Please sign in to comment.