File tree Expand file tree Collapse file tree
.azure-pipelines/common-templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,12 +49,17 @@ steps:
4949 workingFile : $(Build.SourcesDirectory)/autorest.powershell/common/config/rush/.npmrc
5050
5151 - task : PowerShell@2
52- displayName : Set npm userconfig for all npm subprocesses
52+ displayName : Apply npm auth config to user profile
5353 inputs :
5454 targetType : inline
5555 pwsh : true
5656 script : |
57- Write-Host "##vso[task.setvariable variable=NPM_CONFIG_USERCONFIG]$(Build.SourcesDirectory)/.npmrc"
57+ # Copy authenticated .npmrc to the user home dir so ALL npm subprocesses
58+ # (including autorest's internal npm calls) use the private feed + auth tokens.
59+ $src = "$(Build.SourcesDirectory)/.npmrc"
60+ $dst = Join-Path $env:USERPROFILE ".npmrc"
61+ Copy-Item -Path $src -Destination $dst -Force
62+ Write-Host "Copied npm config to $dst"
5863
5964 - task : Npm@1
6065 displayName : Install AutoRest
8590 workingDirectory : " autorest.powershell"
8691 script : |
8792 rush install
93+ if ($LASTEXITCODE -ne 0) { throw "rush install failed with exit code $LASTEXITCODE" }
8894 rush link
89- rush rebuild
95+ if ($LASTEXITCODE -ne 0) { throw "rush link failed with exit code $LASTEXITCODE" }
96+ rush rebuild
97+ if ($LASTEXITCODE -ne 0) { throw "rush rebuild failed with exit code $LASTEXITCODE" }
You can’t perform that action at this time.
0 commit comments