Skip to content

Update create auth npmrc#2925

Merged
chidozieononiwu merged 1 commit into
microsoft:mainfrom
chidozieononiwu:update-create-authenticated-npmrc
Jun 23, 2026
Merged

Update create auth npmrc#2925
chidozieononiwu merged 1 commit into
microsoft:mainfrom
chidozieononiwu:update-create-authenticated-npmrc

Conversation

@chidozieononiwu

Copy link
Copy Markdown
Member

This pull request updates the create-authenticated-npmrc.yml pipeline template to improve how the .npmrc file path is handled and to enhance compatibility and robustness in pipeline jobs. The most important changes are grouped below:

Improvements to .npmrc Path Handling:

  • The npmrcPath parameter now defaults to an empty string, which causes the script to use the agent user's default .npmrc location if not specified, ensuring all subsequent npm-related commands inherit the correct configuration.
  • The script now dynamically sets and uses a resolved .npmrc path, storing it in a pipeline variable (resolvedNpmrcPath) for use in later steps, improving reliability and flexibility.

Code Quality and Consistency:

  • Consistent use of double quotes for parameter defaults and improved formatting for readability.
  • The script now checks for the existence of the parent folder before creating it, and only attempts to create it if necessary, reducing unnecessary operations.
  • The .npmrc file is now created with only the registry line (removing always-auth=true), aligning with updated authentication practices.

@chidozieononiwu chidozieononiwu self-assigned this Jun 22, 2026
Copilot AI review requested due to automatic review settings June 22, 2026 20:50
@chidozieononiwu chidozieononiwu requested a review from a team as a code owner June 22, 2026 20:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 npmrcPath optional (defaults to empty) and resolves the effective path inside the PowerShell step.
  • Stores the resolved path in a pipeline variable (resolvedNpmrcPath) and uses it for npmAuthenticate@0.
  • Simplifies the generated .npmrc content to only include the registry= line.

Comment thread eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml
@chidozieononiwu chidozieononiwu merged commit ab0b24d into microsoft:main Jun 23, 2026
15 of 17 checks passed
@github-project-automation github-project-automation Bot moved this from Untriaged to Done in Azure MCP Server Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants