fix(ci): give the GitHub Packages mirror its own npmrc - #6
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
0.4.0published to npm successfully —+ @engineio/ui@0.4.0, tagged andreleased. Only the mirror step failed, with
ENEEDAUTH.Cause
Third variation on the same theme.
setup-node's npmrc carries auth forregistry.npmjs.orgonly, sonpm publish --registry=npm.pkg.github.comfindsno credential for that host and npm does not fall back. Appending to the
runner's
~/.npmrcdoes nothing either, becauseNPM_CONFIG_USERCONFIGpointsat setup-node's file.
Fix
The step writes its own npmrc with the GitHub Packages auth line and scopes
NPM_CONFIG_USERCONFIGto 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.