Skip to content

ci: give yarn an empty NODE_AUTH_TOKEN on publish - #140

Merged
Fabio1988 merged 1 commit into
mainfrom
ci/yarn-npmrc-auth-token
Aug 18, 2026
Merged

ci: give yarn an empty NODE_AUTH_TOKEN on publish#140
Fabio1988 merged 1 commit into
mainfrom
ci/yarn-npmrc-auth-token

Conversation

@Fabio1988

Copy link
Copy Markdown
Collaborator

setup-node's registry-url writes an .npmrc containing ${NODE_AUTH_TOKEN}. Publishing goes through OIDC trusted publishing, so no such token exists, and yarn v1 aborts rather than expanding an env var that is absent: "Failed to replace env in config".

Defining it as empty is enough for yarn's expansion to succeed. npm reads the same empty value as no auth and falls through to trusted publishing, which is what already happens today.

setup-node's registry-url writes an .npmrc containing
${NODE_AUTH_TOKEN}. Publishing goes through OIDC trusted publishing, so
no such token exists, and yarn v1 aborts rather than expanding an env
var that is absent: "Failed to replace env in config".

Defining it as empty is enough for yarn's expansion to succeed. npm
reads the same empty value as no auth and falls through to trusted
publishing, which is what already happens today.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Fabio1988
Fabio1988 merged commit 4cc3af3 into main Aug 18, 2026
1 check passed
@Fabio1988
Fabio1988 deleted the ci/yarn-npmrc-auth-token branch August 18, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant