fix(ci): pass NODE_AUTH_TOKEN to npm publish step#14
Merged
Conversation
The Release workflow's Publish step ran `npm publish` without an
NODE_AUTH_TOKEN env. actions/setup-node with `registry-url` requires
NODE_AUTH_TOKEN; without it npm attempts an anonymous publish, which
npm rejects with E404 ("Not found") for packages the caller doesn't
own. This blocked every release since v0.1.25 (Jun 6).
Reference the `NPM_TOKEN` repo secret so publish can authenticate.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
Releaseworkflow) which has failed withE404 Not Foundfor every run sincev0.1.25(Jun 6, 2026). npm on the registry is still atlatest: 0.1.25while the repo is at0.1.27.Publishstep runsnpm publish --provenance --access publicwith noNODE_AUTH_TOKENenv.actions/setup-nodewithregistry-urlexpectsNODE_AUTH_TOKENto authenticate the publish. Without it, npm attempts an anonymousPUT, which npm rejects with404 Not Found(it hides existence of packages the caller can't publish to). Provenance signing still succeeds locally, then thePUTis rejected.Change
release.yml→ addenv: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}to thePublishstep.Validation
Publishstep only.NPM_TOKENrepo secret (see below).Required action before merge
This fix references a
NPM_TOKENrepository secret that must exist:xcodebazelmcp.Publishon packagexcodebazelmcp, expiry as needed.Automation(orPublish— avoidLegacy-only read tokens).NPM_TOKEN:GitHub → Settings → Secrets and variables → Actions → New repository secret → Name:
NPM_TOKEN→ paste token.(The publish job uses
environment: npm, so adding it to thenpmenvironment secrets also works and is tighter.)NPM_AUTH_TOKEN,NODE_AUTH_TOKEN), tell me and I'll switch the env reference to match — no need to create a new one.After merge — publishing the missing versions
The repo is at
0.1.27but npmlatestis0.1.25. Tagsv0.1.26andv0.1.27were never pushed, so theon: push: tags: v*trigger never fired. After this PR merges and the token is set, either:gh workflow run release.yml -f bump=patch(usesworkflow_dispatch, which bumps/tags/publishes), orgit push origin v0.1.26 v0.1.27(triggers the tag-driven path). Note: re-checking out old tags republishes exactly those versions, so prefer theworkflow_dispatchpath to publish0.1.28(a fresh bump) instead.I recommend
workflow_dispatchwithbump=patch→ publishes a clean new version that includes this fix plus the merged hardening PR (#13).Notes
homebrew-tapand GitHub Release jobs depend onpublishsuccess, so they've been correctly skipping. They'll resume once publish is unblocked.Co-authored-by: oh-my-pi https://omp.sh