From 5affbc8bdfb844d4f3de4c32c8b855b640f5fa0b Mon Sep 17 00:00:00 2001 From: phips28 Date: Wed, 1 Jun 2022 00:10:19 +0200 Subject: [PATCH] fix #166 --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index 2135b88..abca913 100644 --- a/index.js +++ b/index.js @@ -182,6 +182,9 @@ const workspace = process.env.GITHUB_WORKSPACE; console.log('current 2:', current, '/', 'version:', version); console.log('execute npm version now with the new version:', version); newVersion = execSync(`npm version --git-tag-version=false ${version}`).toString().trim().replace(/^v/, ''); + // fix #166 - npm workspaces + // https://github.com/phips28/gh-action-bump-version/issues/166#issuecomment-1142640018 + newVersion = newVersion.split(/\n/)[1] || newVersion; console.log('newVersion 2:', newVersion); newVersion = `${tagPrefix}${newVersion}`; console.log(`newVersion after merging tagPrefix+newVersion: ${newVersion}`);