ci: OIDC cannot do the first publish — keep a token for it - #15
Closed
catomean wants to merge 1 commit into
Closed
Conversation
Trusted publishing is configured per package on npmjs.com, and a package that has never been published cannot have a trusted publisher configured. The token-free workflow therefore fails on the very first release. Observed on tag v0.1.1: provenance was signed and logged to sigstore, then the PUT returned E404 'could not be found or you do not have permission' — npm answers 404 rather than 401 for an unauthenticated publish of a package that does not exist yet, which reads as a missing package rather than a missing credential. NPM_TOKEN is used only until ai-forms exists and a trusted publisher is configured; npm prefers OIDC after that. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Collaborator
Author
|
Superseded by #14, which landed the same fix (token for the first publish, OIDC afterwards) while this was open. Closing as duplicate — no disagreement, just two sessions reaching it at once. |
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.
#13 removed
NODE_AUTH_TOKENin favour of OIDC trusted publishing. That is the right destination, but it cannot get us there: trusted publishing is configured per package on npmjs.com, and a package that has never been published cannot have a trusted publisher configured.Observed on tag
v0.1.1(run 31953553423):Provenance signing succeeded — that part of OIDC works. The publish itself was unauthenticated, and npm answers 404 rather than 401 for an unauthenticated publish of a non-existent package, which reads like a missing package instead of a missing credential.
This restores
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}on the publish step, keepingid-token: writeand everything else from #13. npm prefers OIDC whenever the package has a trusted publisher, so after the first release this secret is unused and can be deleted.🤖 Generated with Claude Code