Skip to content

fix(ci): give the GitHub Packages mirror its own npmrc - #6

Merged
HaydenBruin merged 1 commit into
mainfrom
fix/mirror-auth
Aug 25, 2026
Merged

fix(ci): give the GitHub Packages mirror its own npmrc#6
HaydenBruin merged 1 commit into
mainfrom
fix/mirror-auth

Conversation

@HaydenBruin

Copy link
Copy Markdown
Contributor

0.4.0 published to npm successfully — + @engineio/ui@0.4.0, tagged and
released. Only the mirror step failed, with ENEEDAUTH.

Cause

Third variation on the same theme. setup-node's npmrc carries auth for
registry.npmjs.org only, so npm publish --registry=npm.pkg.github.com finds
no credential for that host and npm does not fall back. Appending to the
runner's ~/.npmrc does nothing either, because NPM_CONFIG_USERCONFIG points
at setup-node's file.

Fix

The step writes its own npmrc with the GitHub Packages auth line and scopes
NPM_CONFIG_USERCONFIG to that one command.

It also treats "version already published" on the mirror as success. The npm
publish runs first and is irreversible, so without that a re-run after any
mirror failure would fail forever on a conflict it cannot clear — by then the
release is already out on the canonical registry and the mirror catching up is
exactly what we want.

The mirror step failed with ENEEDAUTH while the npm publish immediately above
it succeeded. Same root cause as the earlier 401s, third variation:
setup-node's npmrc carries auth for registry.npmjs.org only, so publishing with
--registry=npm.pkg.github.com finds no credential for that host and npm does
not fall back. Appending to the runner's ~/.npmrc does not help either, because
NPM_CONFIG_USERCONFIG points elsewhere.

The step now writes its own npmrc with the GitHub Packages auth line and points
NPM_CONFIG_USERCONFIG at it for that one command.

Also treats "version already published" on the mirror as success. The npm
publish happens first and is irreversible, so a re-run after a mirror failure
would otherwise fail forever on a conflict it cannot clear — the release is
already out on the canonical registry at that point, and the mirror catching up
is the desired outcome.

Confirmed working before this fix: 0.4.0 published to npm ("+ @engineio/ui@0.4.0",
"Published release 0.4.0 on default channel"), tagged, and released. Only the
mirror was broken.
@HaydenBruin
HaydenBruin merged commit 9be6199 into main Aug 25, 2026
1 check 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.

1 participant