Skip to content

fix(publish): authenticate pnpm publish via ~/.npmrc, not a URL-scoped env var (RIG-2187) - #3

Merged
mattwilkinsonn merged 1 commit into
mainfrom
compass-ui/rig-2187-publish-authfix
Aug 23, 2026
Merged

fix(publish): authenticate pnpm publish via ~/.npmrc, not a URL-scoped env var (RIG-2187)#3
mattwilkinsonn merged 1 commit into
mainfrom
compass-ui/rig-2187-publish-authfix

Conversation

@rigel-mintaka

Copy link
Copy Markdown
Collaborator

The first tagged publish of @rigelbuild/solid-virtual@3.0.0-rc.0 failed with a
404 on the PUT: the publish went out unauthenticated. Root cause: the auth
token was passed as a GitHub Actions step env var literally named
pnpm_config_//registry.npmjs.org/:_authToken, but Actions env-var names may
only contain [A-Za-z0-9_] — a name with /, : and . is never exported to
the step, so pnpm never received the credential and npm answers a scoped
unauthenticated write with 404 (not 401). The clean-named pnpm_config_provenance
exported fine, which is why only auth broke.

Fix (source-verified against pnpm 11.9.0): write the per-registry
//registry.npmjs.org/:_authToken into the user-level ~/.npmrc from the
clean-named NPM_TOKEN secret before pnpm publish. pnpm's credential reader
(getNetworkConfigs -> configByUri) consumes the user npmrc unconditionally, so
the token reaches the publish request. The npmrc is written on the CI runner
only, so the upstreamable package diff (DL-015) is untouched. Provenance stays
off via the env key and job permissions stay contents: read (no OIDC).

Nothing was published on the failed run (404 = create rejected), so 3.0.0-rc.0
is not burned; re-tag re-triggers the publish.

@linear-code

linear-code Bot commented Aug 23, 2026

Copy link
Copy Markdown

RIG-2187

@github-actions

Copy link
Copy Markdown

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@rigel-mintaka
rigel-mintaka force-pushed the compass-ui/rig-2187-publish-authfix branch from a7ddff5 to 13e68f3 Compare August 23, 2026 14:38
…d env var (RIG-2187)

The first tagged publish of @rigelbuild/solid-virtual@3.0.0-rc.0 failed with a
404 on the PUT: the publish went out unauthenticated. Root cause: the auth
token was passed as a GitHub Actions step env var literally named
`pnpm_config_//registry.npmjs.org/:_authToken`, but Actions env-var names may
only contain [A-Za-z0-9_] — a name with `/`, `:` and `.` is never exported to
the step, so pnpm never received the credential and npm answers a scoped
unauthenticated write with 404 (not 401). The clean-named `pnpm_config_provenance`
exported fine, which is why only auth broke.

Fix (source-verified against pnpm 11.9.0): write the per-registry
`//registry.npmjs.org/:_authToken` into the user-level `~/.npmrc` from the
clean-named `NPM_TOKEN` secret before `pnpm publish`. pnpm's credential reader
(getNetworkConfigs -> configByUri) consumes the user npmrc unconditionally, so
the token reaches the publish request. The npmrc is written on the CI runner
only, so the upstreamable package diff (DL-015) is untouched. Provenance stays
off via the env key and job permissions stay `contents: read` (no OIDC).

Nothing was published on the failed run (404 = create rejected), so 3.0.0-rc.0
is not burned; re-tag re-triggers the publish.
@rigel-mintaka
rigel-mintaka force-pushed the compass-ui/rig-2187-publish-authfix branch from 13e68f3 to 2a9beda Compare August 23, 2026 14:44
@mattwilkinsonn
mattwilkinsonn marked this pull request as ready for review August 23, 2026 16:23
@mattwilkinsonn
mattwilkinsonn merged commit 176420d into main Aug 23, 2026
7 checks passed
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.

2 participants