Skip to content

Commit ec35bd8

Browse files
authored
fix(ci): publish stage requires auth (#326014)
1 parent 18b7325 commit ec35bd8

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

build/azure-pipelines/product-publish.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,23 @@ jobs:
5454
- pwsh: Write-Host "##vso[build.addbuildtag]🚀"
5555
displayName: Add build tag
5656

57+
- pwsh: |
58+
$ErrorActionPreference = 'Stop'
59+
# Set the private NPM registry to the global npmrc file
60+
# so that authentication works for subfolders like build/, remote/, extensions/ etc
61+
# which does not have their own .npmrc file
62+
npm config set registry "$env:NPM_REGISTRY"
63+
$NpmrcPath = (npm config get userconfig)
64+
Write-Host "##vso[task.setvariable variable=NPMRC_PATH]$NpmrcPath"
65+
condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))
66+
displayName: Setup NPM
67+
68+
- task: npmAuthenticate@0
69+
inputs:
70+
workingFile: $(NPMRC_PATH)
71+
condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))
72+
displayName: Setup NPM Authentication
73+
5774
- pwsh: |
5875
npm ci
5976
workingDirectory: build

0 commit comments

Comments
 (0)