fix(release): diagnose npm auth before building, and allow re-publishing a tag - #11
Merged
Conversation
…ing a tag Two releases have now failed at the same place with npm error 404 Not Found - PUT https://registry.npmjs.org/@phall%2fphui-... npm reports 'you cannot publish here' as a 404 because it will not leak whether a scope exists, which makes it indistinguishable from a typo'd package name. Both times that cost a full release to learn nothing, because the one fact the 404 hides — which account the token authenticates as — is never printed. The verify job now resolves that up front with npm whoami, prints both the account and the scope being published to, and fails with the actual explanation when they disagree. It runs once, before four binaries get built. Also adds workflow_dispatch with a tag input, so a publish that failed for reasons unrelated to the code can be retried against an existing tag without cutting a release to carry the fix.
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.
Two releases have failed at the same point with
404 Not Found - PUT, and neither told us anything useful — npm reports "you cannot publish here" as a 404 so it doesn't leak whether a scope exists, which is indistinguishable from a typo'd package name.The fact that would settle it — which account the token authenticates as — is never printed anywhere.
Preflight in
verify: runsnpm whoami, prints the authenticated account and the scope being published to, and fails with the real explanation if they disagree. Runs once, before four binaries get built, instead of failing four times at the end.workflow_dispatchwith a tag input: lets a failed publish be retried against an existing tag. Right now fixing a publish problem requires cutting a release to carry the fix, even when the released code is already correct — v0.14.1 already has the right package name.Together these mean the next attempt either publishes, or tells us in one line who the token really is.