fix(ci): use OIDC for npm publish instead of token auth#10619
Merged
jasonsaayman merged 3 commits intoaxios:v1.xfrom Apr 1, 2026
Merged
fix(ci): use OIDC for npm publish instead of token auth#10619jasonsaayman merged 3 commits intoaxios:v1.xfrom
jasonsaayman merged 3 commits intoaxios:v1.xfrom
Conversation
jasonsaayman
approved these changes
Apr 1, 2026
This was referenced Apr 2, 2026
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
RemoveSome maintainer-side configuration on npmjs.com and GitHub is also required (see checklist below).NODE_AUTH_TOKENso npm authenticates via OIDC instead of a long-lived token. WhenNODE_AUTH_TOKENis set, npm uses it and skips OIDC entirely, so removing it is the only code change needed to enable Trusted Publishing.The workflow already has
id-token: writeand--provenance.Resolves #7055.
Maintainer steps (before merge)
npm will reject publishes until the trusted publisher is configured, so these need to happen first:
npmjs.com
axios, repoaxios, workflowpublish.yml, environment blankGitHub
NPM_TOKENFollow-up: tag protection
There currently appear to be no tag protection rules or rulesets on
v*.*.*tags, so any org member with write access could push a tag and trigger a publish. Worth considering a tag ruleset restricting who can create version tags, or a GitHub Environment with required reviewers on the publish job, or both.Test plan
Summary by cubic
Switch
npmpublish to OIDC Trusted Publishing by removingNODE_AUTH_TOKENand reducing workflow permissions to least privilege. This improves security, removes long‑lived tokens, and preserves provenance on releases.Description
Summary of changes
NODE_AUTH_TOKENfrom.github/workflows/publish.ymlsonpmuses OIDC.contents: readand keptid-token: write.npm publish --provenance.Reasoning
npmignores OIDC whenNODE_AUTH_TOKENis set; removing it enables Trusted Publishing.Additional context
v1.*.*tags or using a publish Environment with reviewers.Docs
On
npmjs.comaxios, repoaxios, workflowpublish.yml.On GitHub
NPM_TOKEN.contents: read,id-token: write(already set in workflow).Testing
NODE_AUTH_TOKENand provenance appears onnpmjs.com.contentsscope.Written for commit f5ef404. Summary will update on new commits.