diff --git a/lib/plugin/GitBase.js b/lib/plugin/GitBase.js index 0ac217ea..072772e1 100644 --- a/lib/plugin/GitBase.js +++ b/lib/plugin/GitBase.js @@ -9,12 +9,14 @@ class GitBase extends Plugin { async init() { this.remoteUrl = await this.getRemoteUrl(); await this.fetch(); + const branchName = await this.getBranchName(); + this.setContext({ branchName }); const repo = parseGitUrl(this.remoteUrl); const latestTag = await this.getLatestTagName(repo); const secondLatestTag = !this.config.isIncrement ? await this.getSecondLatestTagName(latestTag) : null; const tagTemplate = this.options.tagName || ((latestTag || '').match(/^v/) ? 'v${version}' : '${version}'); this.setContext({ repo }); - this.config.setContext({ tagTemplate, latestTag, secondLatestTag }); + this.config.setContext({ tagTemplate, latestTag, secondLatestTag, branchName }); } getName() {