Update create auth npmrc#2925
Merged
chidozieononiwu merged 1 commit intoJun 23, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the shared Azure Pipelines step template for creating and authenticating an .npmrc, aiming to make .npmrc path handling more flexible and consistent across pipeline jobs.
Changes:
- Makes
npmrcPathoptional (defaults to empty) and resolves the effective path inside the PowerShell step. - Stores the resolved path in a pipeline variable (
resolvedNpmrcPath) and uses it fornpmAuthenticate@0. - Simplifies the generated
.npmrccontent to only include theregistry=line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the
create-authenticated-npmrc.ymlpipeline template to improve how the.npmrcfile path is handled and to enhance compatibility and robustness in pipeline jobs. The most important changes are grouped below:Improvements to
.npmrcPath Handling:npmrcPathparameter now defaults to an empty string, which causes the script to use the agent user's default.npmrclocation if not specified, ensuring all subsequent npm-related commands inherit the correct configuration..npmrcpath, storing it in a pipeline variable (resolvedNpmrcPath) for use in later steps, improving reliability and flexibility.Code Quality and Consistency:
.npmrcfile is now created with only the registry line (removingalways-auth=true), aligning with updated authentication practices.