From c662296d470fe89a4a61e97e61e0f12aec31c56d Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Wed, 26 Jan 2022 15:11:55 -0800 Subject: [PATCH 1/2] Another publish fix --- scripts/bump-oss-version.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/bump-oss-version.js b/scripts/bump-oss-version.js index 854b45cb83a8a5..ec2af311a307c5 100755 --- a/scripts/bump-oss-version.js +++ b/scripts/bump-oss-version.js @@ -72,10 +72,15 @@ let branch; if (!nightlyBuild) { - // Check we are in release branch, e.g. 0.33-stable - branch = exec('git symbolic-ref --short HEAD', { - silent: true, - }).stdout.trim(); + if (process.env.BUILD_SOURCEBRANCH) { + console.log(`BUILD_SOURCEBRANCH: ${process.env.BUILD_SOURCEBRANCH}`); + branch = process.env.BUILD_SOURCEBRANCH.match(/refs\/heads\/(.*)/)[1]; + console.log(`Identified branch: ${branch}`); + } else { + branch = exec('git symbolic-ref --short HEAD', { + silent: true, + }).stdout.trim(); + } if (branch.indexOf('-stable') === -1) { echo('You must be in 0.XX-stable branch to bump a version'); From 1ca2cbaa61a88a929d67c20f5ac946ebe4985ffa Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Wed, 26 Jan 2022 16:11:34 -0800 Subject: [PATCH 2/2] put comment back --- scripts/bump-oss-version.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/bump-oss-version.js b/scripts/bump-oss-version.js index ec2af311a307c5..6fa6d1c83b449b 100755 --- a/scripts/bump-oss-version.js +++ b/scripts/bump-oss-version.js @@ -72,6 +72,7 @@ let branch; if (!nightlyBuild) { + // Check we are in release branch, e.g. 0.33-stable if (process.env.BUILD_SOURCEBRANCH) { console.log(`BUILD_SOURCEBRANCH: ${process.env.BUILD_SOURCEBRANCH}`); branch = process.env.BUILD_SOURCEBRANCH.match(/refs\/heads\/(.*)/)[1];