fix(ci): publish stage requires auth (#326014)

This commit is contained in:
Raymond Zhao
2026-07-15 19:12:56 +00:00
committed by GitHub
parent 18b7325a78
commit ec35bd859b
+17
View File
@@ -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