Sync eng/common directory with azure-sdk-tools for PR 14343#6984
Sync eng/common directory with azure-sdk-tools for PR 14343#6984chidozieononiwu merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Syncs the shared eng/common Azure Pipelines npm publishing job with the corresponding change from azure-sdk-tools PR 14343, aiming to ensure npm publishing/verification uses the intended public npm registry behavior.
Changes:
- Adds a step (when publishing to
https://registry.npmjs.org/) to delete a repo-level.npmrcbefore running ESRP publishing.
| - task: PowerShell@2 | ||
| displayName: 'Delete repo .npmrc' | ||
| inputs: | ||
| targetType: inline | ||
| script: | | ||
| $npmrcPath = "$(System.DefaultWorkingDirectory)/.npmrc" | ||
| if (Test-Path $npmrcPath) { | ||
| Remove-Item -Path $npmrcPath -Force | ||
| Write-Host "Deleted $npmrcPath to use default npmjs registry." | ||
| } else { | ||
| Write-Host "No repo .npmrc found at $npmrcPath." | ||
| } | ||
| pwsh: true | ||
|
|
There was a problem hiding this comment.
Deleting the repo-level .npmrc mutates the checked-out sources and can also remove unrelated npm settings (e.g., proxy/strict-ssl) that might be required for network access on some agents. A more deterministic approach is to leave the file alone and force npm view (in the tag verification step) to use ${{ parameters.Registry }} via --registry or NPM_CONFIG_REGISTRY, so the job always queries npmjs regardless of any .npmrc in the repo/workspace.
| - task: PowerShell@2 | |
| displayName: 'Delete repo .npmrc' | |
| inputs: | |
| targetType: inline | |
| script: | | |
| $npmrcPath = "$(System.DefaultWorkingDirectory)/.npmrc" | |
| if (Test-Path $npmrcPath) { | |
| Remove-Item -Path $npmrcPath -Force | |
| Write-Host "Deleted $npmrcPath to use default npmjs registry." | |
| } else { | |
| Write-Host "No repo .npmrc found at $npmrcPath." | |
| } | |
| pwsh: true |
2c1d047 to
ac75fd4
Compare
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#14343 See eng/common workflow