From 304b49a7ffdf3adf8fc3e3234e11455b05062c2a Mon Sep 17 00:00:00 2001 From: KarunaLakshman Date: Sun, 5 May 2019 20:08:37 +0200 Subject: [PATCH] feat: suggest branch name other than master (#331) --- lib/lifecycles/tag.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/lifecycles/tag.js b/lib/lifecycles/tag.js index a7b40191d..9de7cd978 100644 --- a/lib/lifecycles/tag.js +++ b/lib/lifecycles/tag.js @@ -25,8 +25,9 @@ function execTag (newVersion, pkgPrivate, args) { } checkpoint(args, 'tagging release %s%s', [args.tagPrefix, newVersion]) return runExec(args, 'git tag ' + tagOption + args.tagPrefix + newVersion + ' -m "' + formatCommitMessage(args.message, newVersion) + '"') - .then(() => { - let message = 'git push --follow-tags origin master' + .then(() => runExec(args, 'git rev-parse --abbrev-ref HEAD')) + .then((currentBranch) => { + let message = 'git push --follow-tags origin ' + currentBranch.trim() if (pkgPrivate !== true) { message += ' && npm publish' if (args.prerelease !== undefined) {