diff --git a/eng/pipelines/templates/BuildAndTest.yml b/eng/pipelines/templates/BuildAndTest.yml index 98401edb18c..f8309057b92 100644 --- a/eng/pipelines/templates/BuildAndTest.yml +++ b/eng/pipelines/templates/BuildAndTest.yml @@ -167,19 +167,16 @@ steps: $(_OfficialBuildIdArgs) displayName: Pack docs transport package - - task: npmAuthenticate@0 - inputs: - workingFile: $(Build.SourcesDirectory)/src/Libraries/Microsoft.Extensions.AI.Evaluation.Reporting/TypeScript/.npmrc - displayName: Authenticate npm for Azure DevOps plugin (root) - - - task: npmAuthenticate@0 - inputs: - workingFile: $(Build.SourcesDirectory)/src/Libraries/Microsoft.Extensions.AI.Evaluation.Reporting/TypeScript/azure-devops-report/tasks/PublishAIEvaluationReport/.npmrc - displayName: Authenticate npm for Azure DevOps plugin (task) - - 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