diff --git a/eng/pipelines/templates/BuildAndTest.yml b/eng/pipelines/templates/BuildAndTest.yml index f8309057b92..ce540adfa24 100644 --- a/eng/pipelines/templates/BuildAndTest.yml +++ b/eng/pipelines/templates/BuildAndTest.yml @@ -170,13 +170,6 @@ steps: - pwsh: | $(Build.SourcesDirectory)/src/Libraries/Microsoft.Extensions.AI.Evaluation.Reporting/TypeScript/azure-devops-report/build.ps1 -OutputPath $(Build.Arcade.VSIXOutputPath) displayName: Build Azure DevOps plugin - env: - # Some CI agents have stale npm auth tokens in the user-level .npmrc - # (e.g. C:\Users\cloudtest\.npmrc). npm sends these stale credentials - # to the public dotnet-public-npm feed, causing E401 errors. Override - # the user config path to a non-existent file so npm ignores stale - # credentials and uses anonymous access for the public feed. - NPM_CONFIG_USERCONFIG: $(Agent.TempDirectory)/.npmrc-not-exists - script: ${{ parameters.buildScript }} -restore diff --git a/src/Libraries/Microsoft.Extensions.AI.Evaluation.Reporting/TypeScript/azure-devops-report/build.ps1 b/src/Libraries/Microsoft.Extensions.AI.Evaluation.Reporting/TypeScript/azure-devops-report/build.ps1 index 23d623f9491..80c6ee709ea 100644 --- a/src/Libraries/Microsoft.Extensions.AI.Evaluation.Reporting/TypeScript/azure-devops-report/build.ps1 +++ b/src/Libraries/Microsoft.Extensions.AI.Evaluation.Reporting/TypeScript/azure-devops-report/build.ps1 @@ -21,6 +21,13 @@ if ($null -eq $PackageVersion) Write-Host "Using version $PackageVersion" +# Some CI agents have stale npm auth tokens in user or global .npmrc files +# (e.g. C:\Users\cloudtest\.npmrc) that cause E401 errors against the public +# dotnet-public-npm feed. Override both config paths so npm ignores stale +# agent-level credentials and accesses the public feed anonymously. +$env:NPM_CONFIG_USERCONFIG = "$env:TEMP\no-user-npmrc" +$env:NPM_CONFIG_GLOBALCONFIG = "$env:TEMP\no-global-npmrc" + # Write-Information "Building Report Publishing task" Set-Location $PSScriptRoot/tasks/PublishAIEvaluationReport npm ci --omit=dev