You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
npm ERR! code ENEEDAUTH
npm ERR! need auth This command requires you to be logged in to https://registry.npmjs.org/
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2024-05-07T13_20_44_932Z-debug-0.log
Error: Process completed with exit code 1.
This is user error, and it's related to using a shared workflow.
For anyone else who runs into this, the issue is that the caller workflow needs to explicitly mark secrets to inherit. So for example:
name: Publish package
on:
push:
tags:
- "v*"
jobs:
publish:
uses: ./.github/workflows/js-shared-publish.yaml
with:
package: "./packages/my-package"
secrets: inherit # <--- ensure this line is present
Without that, the NPM_TOKEN secret is not present in the shared workflow and publish fails.
I looked into .npmrc, and it doesn't seem to matter whether always-auth=false is true or false. It seems to default to false, which works, although the docs do say it should be true.
Description:
pnpm publish
fails with a 401.Action version:
actions/setup-node@v4
Platform:
Runner type:
Tools version:
Node: 16.x
PNPM: 8
Repro steps:
I have a shared workflow https://github.com/thekevinscott/Autogrammer/blob/main/.github/workflows/js-shared-publish.yaml that is failing with 401. The workflow is:
This is an example of an executed action. The error reports:
When I
cat $NPM_CONFIG_USERCONFIG
, I see:Whereas in the docs, it's indicated that
always-auth
is supposed to betrue
.Could that be the source of the troubles? Or could it be related to the usage of a shared workflow?
Expected behavior:
I'd like to be able to publish.
Actual behavior:
Publish reports 401.
The text was updated successfully, but these errors were encountered: