Skip to content

Stop adding always-auth to the .npmrc file #1305

@hashtagchris

Description

@hashtagchris

Description:
Stop adding always-auth = (Boolean) to the .npmrc file by default.

Consider removing the always-auth actions input and all related code.

If there's an upcoming major release in the next year or so, this change can be incorporated into that to ensure stable workflows aren't impacted.

Justification:
always-auth was removed from the npm cli in 2021: npm/cli@72a7eeb. npm 6 (?) was the last release to honor this flag. See https://docs.npmjs.com/cli/v6/commands/npm-adduser vs newer docs.

npm cli 11 warns npm warn Unknown user config "always-auth". This will stop working in the next major version of npm.

Are you willing to submit a PR?
Yes

Related

Addition of always-auth: #48

Sample workflow run: https://github.com/hashtagchris/junk-drawer/actions/runs/15785443544/job/44500732542#step:5:8

Sample workflow

This reproduces the npm 11 warning

name: npm always-auth warning
on: workflow_dispatch

jobs:
  repro:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Install Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
          registry-url: 'https://registry.npmjs.org/'

      - name: Install the latest version of the npm CLI
        run: |
          npm install -g npm@latest

      # Run various npm commands to trigger the warning
      - run: npm --version
      - run: npm config ls

      - name: Inspect the config set up by setup-node
        run: |
          cat /home/runner/work/_temp/.npmrc

Metadata

Metadata

Assignees

Labels

feature requestNew feature or request to improve the current logic

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions