ci: migrate npm publish to Trusted Publishing (OIDC) - #218
Conversation
npm is deprecating bypass-2FA token publishing (phased out by Jan 2027), so drop the NPMJS_TOKEN-based auth in favor of OIDC trusted publishing. Requires npm >= 11.5.1, pinned via npm install -g npm@11.5.1.
|
Warning Review limit reached
Next review available in: 32 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughThe version release workflow now installs npm 11.5.1 before publication. The npm publish step no longer maps ChangesRelease publishing
Estimated code review effort: 1 (Trivial) | ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/version-release.yml:
- Around line 178-180: Restructure the release workflow so the npm upgrade and
package preparation/packing run in a separate job without id-token permissions.
Keep the publish operation in a minimal job that alone grants id-token: write,
and pass the prepared package artifact between jobs for publishing.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 115fbe48-656d-4ce8-947a-32e8eed9e822
📒 Files selected for processing (1)
.github/workflows/version-release.yml
Untrusted code (pnpm install, lint) previously ran in the same job as id-token: write, so a compromised dependency could have exfiltrated the OIDC token before the publish step ran. Build and pack the tarball in a job with no token access, then publish it from a minimal job that only handles the tarball and the actual publish call.
Addressed Issues:
N/A — operational CI fix, not tracked by an issue. Context: npm is deprecating "Bypass 2FA" granular access tokens (see https://github.blog/changelog/2026-07-08-npm-install-time-security-and-gat-bypass2fa-deprecation/). Phase 1 (Aug 2026) already restricts these tokens for sensitive operations, and Phase 2 (~Jan 2027) removes their ability to publish at all, including to existing packages like
@aossie-org/social-share-button. This mirrors the same migration already done for ThruBox-Client (AOSSIE-Org/ThruBox-Client#28) and IndexedDB-Import-Export (AOSSIE-Org/IndexedDB-Import-Export#61).Screenshots/Recordings:
N/A — CI workflow change only.
Additional Notes:
NPMJS_TOKEN-based auth from thepublishjob.npm install -g npm@11.5.1step, since Trusted Publishing requires npm >= 11.5.1. Pinned to an exact version rather than@latestto avoid pulling unreviewed npm CLI code into a job that holdsid-token: write.@aossie-org/social-share-buttonon npmjs.com (Package Settings → Trusted Publisher → GitHub Actions → orgAOSSIE-Org, repoSocialShareButton, workflowversion-release.yml, allowed actionnpm publish). Until that's set up, this workflow will fail since it no longer supplies a token.NPMJS_TOKENsecret used here can be removed.Checklist
Summary by CodeRabbit