From ec35bd859bebbaccb2bcfb99a8b2ea1a6cdd20cf Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Wed, 15 Jul 2026 12:12:56 -0700 Subject: [PATCH] fix(ci): publish stage requires auth (#326014) --- build/azure-pipelines/product-publish.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/build/azure-pipelines/product-publish.yml b/build/azure-pipelines/product-publish.yml index 6403a6303a1..711e496ac6b 100644 --- a/build/azure-pipelines/product-publish.yml +++ b/build/azure-pipelines/product-publish.yml @@ -54,6 +54,23 @@ jobs: - pwsh: Write-Host "##vso[build.addbuildtag]🚀" displayName: Add build tag + - pwsh: | + $ErrorActionPreference = 'Stop' + # Set the private NPM registry to the global npmrc file + # so that authentication works for subfolders like build/, remote/, extensions/ etc + # which does not have their own .npmrc file + npm config set registry "$env:NPM_REGISTRY" + $NpmrcPath = (npm config get userconfig) + Write-Host "##vso[task.setvariable variable=NPMRC_PATH]$NpmrcPath" + condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) + displayName: Setup NPM + + - task: npmAuthenticate@0 + inputs: + workingFile: $(NPMRC_PATH) + condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) + displayName: Setup NPM Authentication + - pwsh: | npm ci workingDirectory: build