From 9cbd6cfcc21c96fc3400a18fe6e1e742281fbb31 Mon Sep 17 00:00:00 2001 From: phips28 Date: Sat, 26 Oct 2019 21:53:54 +0200 Subject: [PATCH] fix tag command --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index a0cbca2..14c4498 100644 --- a/index.js +++ b/index.js @@ -33,14 +33,14 @@ Toolkit.run(async tools => { await tools.runInWorkspace('npm', ['version', '--allow-same-version=true', '--git-tag-version=false', current]) console.log('current:', current, '/', 'version:', version) - const newVersion = execSync(`npm version --git-tag-version=false ${version}`).toString() + const newVersion = execSync(`npm version --git-tag-version=false ${version}`).toString().trim() console.log('new version:', newVersion) await tools.runInWorkspace('git', ['commit', '-a', '-m', `"ci: ${commitMessage} ${newVersion}"`]) const remoteRepo = `https://${process.env.GITHUB_ACTOR}:${process.env.GITHUB_TOKEN}@github.com/${process.env.GITHUB_REPOSITORY}.git` console.log('remoteRepo:', remoteRepo) - await tools.runInWorkspace('git', ['tag', `-a "${newVersion}"`]) + await tools.runInWorkspace('git', ['tag', '-a', newVersion]) await tools.runInWorkspace('git', ['push', `"${remoteRepo}"`, '--follow-tags']) await tools.runInWorkspace('git', ['push', `"${remoteRepo}"`, '--tags']) } catch (e) {