diff --git a/build/azure-pipelines/common/createBuild.js b/build/azure-pipelines/common/createBuild.js index 3f56a717fbe..57bb87fedcf 100644 --- a/build/azure-pipelines/common/createBuild.js +++ b/build/azure-pipelines/common/createBuild.js @@ -21,9 +21,9 @@ function getEnv(name) { async function main() { const [, , _version] = process.argv; const quality = getEnv('VSCODE_QUALITY'); - const commit = process.env['VSCODE_DISTRO_COMMIT'] || getEnv('BUILD_SOURCEVERSION'); + const commit = process.env['VSCODE_DISTRO_COMMIT']?.trim() || getEnv('BUILD_SOURCEVERSION'); const queuedBy = getEnv('BUILD_QUEUEDBY'); - const sourceBranch = process.env['VSCODE_DISTRO_REF'] || getEnv('BUILD_SOURCEBRANCH'); + const sourceBranch = process.env['VSCODE_DISTRO_REF']?.trim() || getEnv('BUILD_SOURCEBRANCH'); const version = _version + (quality === 'stable' ? '' : `-${quality}`); console.log('Creating build...'); console.log('Quality:', quality); @@ -34,7 +34,7 @@ async function main() { timestamp: (new Date()).getTime(), version, isReleased: false, - private: Boolean(process.env['VSCODE_DISTRO_REF']), + private: Boolean(process.env['VSCODE_DISTRO_REF']?.trim()), sourceBranch, queuedBy, assets: [], diff --git a/build/azure-pipelines/common/createBuild.ts b/build/azure-pipelines/common/createBuild.ts index d8b0fbff05f..8b1db94c412 100644 --- a/build/azure-pipelines/common/createBuild.ts +++ b/build/azure-pipelines/common/createBuild.ts @@ -27,9 +27,9 @@ function getEnv(name: string): string { async function main(): Promise { const [, , _version] = process.argv; const quality = getEnv('VSCODE_QUALITY'); - const commit = process.env['VSCODE_DISTRO_COMMIT'] || getEnv('BUILD_SOURCEVERSION'); + const commit = process.env['VSCODE_DISTRO_COMMIT']?.trim() || getEnv('BUILD_SOURCEVERSION'); const queuedBy = getEnv('BUILD_QUEUEDBY'); - const sourceBranch = process.env['VSCODE_DISTRO_REF'] || getEnv('BUILD_SOURCEBRANCH'); + const sourceBranch = process.env['VSCODE_DISTRO_REF']?.trim() || getEnv('BUILD_SOURCEBRANCH'); const version = _version + (quality === 'stable' ? '' : `-${quality}`); console.log('Creating build...'); @@ -42,7 +42,7 @@ async function main(): Promise { timestamp: (new Date()).getTime(), version, isReleased: false, - private: Boolean(process.env['VSCODE_DISTRO_REF']), + private: Boolean(process.env['VSCODE_DISTRO_REF']?.trim()), sourceBranch, queuedBy, assets: [],