Skip to content

[enhancement]: Support .yarnrc.yml in NpmAuthenticateV0 #21684

@AntaresQAQ

Description

@AntaresQAQ

Task name

No response

Describe your feature request here

Summary:
Currently, the NpmAuthenticateV0 task only modifies .npmrc for authentication and registry setup. Yarn v1 can read .npmrc and works with NpmAuthenticateV0, but Yarn v3 and v4 do not read .npmrc and instead rely on .yarnrc.yml. This prevents pipelines using Yarn v3/v4 from automatically authenticating to private registries with NpmAuthenticateV0.

Use Case / Motivation:
Modern projects are increasingly adopting Yarn v3/v4. Without native support for .yarnrc.yml, CI/CD pipelines cannot leverage NpmAuthenticateV0 to authenticate to private registries, requiring manual workarounds.

Proposed Solution:

  • Detect .yarnrc.yml in the repository.
  • Apply authentication and registry settings to the pipeline environment in a way compatible with Yarn v3/v4 commands (yarn install, yarn npm publish, etc.).
  • Maintain backward compatibility with .npmrc for Yarn v1 and npm.

Benefits:

  • Seamless CI/CD for projects using Yarn v3/v4.
  • Eliminate manual registry configuration in pipelines.
  • Align NpmAuthenticateV0 with modern Yarn workflows.

References:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions