Sync eng/common directory with azure-sdk-tools for PR 14353#48257
Sync eng/common directory with azure-sdk-tools for PR 14353#48257chidozieononiwu merged 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Syncs eng/common pipeline logic with azure-sdk-tools PR 14353 by introducing a reusable step for resetting the npm registry and using it from the npm publish job.
Changes:
- Added a new
reset-npmrc.ymlstep template to set the project npm registry. - Updated
npm-publish.ymlto use the new template instead of deleting.npmrc.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| eng/common/pipelines/templates/steps/reset-npmrc.yml | New step template to reset npm registry configuration for the current project. |
| eng/common/pipelines/templates/jobs/npm-publish.yml | Swaps inline .npmrc deletion with the new reset-npmrc step template for npmjs publishing. |
Comments suppressed due to low confidence (1)
eng/common/pipelines/templates/steps/reset-npmrc.yml:7
- This template always runs the PowerShell task (no
condition). To be consistent with other step templates and to avoid failing jobs that intentionally skip publishing, consider adding aCustomConditionparameter (defaulting tosucceeded()) and applying it to the task viacondition: ${{ parameters.CustomCondition }}.
parameters:
Registry: 'https://registry.npmjs.org/'
steps:
- task: PowerShell@2
displayName: 'Set project npm registry'
inputs:
| Write-Host "No repo .npmrc found at $npmrcPath." | ||
| } | ||
| pwsh: true | ||
| - template: /eng/common/pipelines/templates/steps/reset-npmrc.yml |
There was a problem hiding this comment.
The new reset-npmrc template step is invoked unconditionally. Previously the deleted-.npmrc step had condition: and(succeeded(), ne(variables['SkipPublishing'], 'true')); without that, a build with no packages (SkipPublishing=true) will still run npm config ... and can fail the job even though publishing is meant to be skipped. Add the same condition to the template invocation or have the template accept a CustomCondition parameter and apply it to the task.
| - template: /eng/common/pipelines/templates/steps/reset-npmrc.yml | |
| - template: /eng/common/pipelines/templates/steps/reset-npmrc.yml | |
| condition: and(succeeded(), ne(variables['SkipPublishing'], 'true')) |
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#14353 See eng/common workflow