ci: migrate npm publish to Trusted Publishing (OIDC) - #28
Conversation
e32fe31 to
b0634c2
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
WalkthroughThe release workflow now builds an npm tarball in a separate job. The publish job downloads the tarball, installs npm 11.5.1, and publishes with provenance and public access. Manual token verification and token-based publishing configuration are removed. Changesnpm release workflow
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant Release
participant Build
participant Artifact
participant Publish
participant NPM
Release->>Build: Start after published release
Build->>Artifact: Create and upload npm tarball
Publish->>Artifact: Download npm tarball
Publish->>Publish: Install npm@11.5.1
Publish->>NPM: Publish with provenance and public access
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 173-175: Update the “Update npm for Trusted Publishing” workflow
step to install a specific pinned npm CLI version compatible with Node 22 and
Trusted Publishing instead of npm@latest. Keep future version changes explicit
by requiring an intentional workflow update.
🪄 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: fb7b8d12-52a0-47d8-85a8-ea51b45d9654
📒 Files selected for processing (1)
.github/workflows/version-release.yml
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
AOSSIE-Org/ThruBox-Server(manual)
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, bumped via npm install -g npm@latest.
b0634c2 to
15f77a6
Compare
Untrusted code (dependency installs, build/test scripts) 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.
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
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 blocks these tokens from creating new packages, which is why
@aossie-org/thrubox-client's first publish kept failing with a 404 in CI. Phase 2 (~Jan 2027) removes their ability to publish at all, even to existing packages.Screenshots/Recordings:
N/A — CI workflow change only.
Additional Notes:
NPMJS_TOKEN-based auth and the now-unnecessary "Verify npm authentication" step from thepublishjob.npm install -g npm@lateststep, since Trusted Publishing requires npm >= 11.5.1 (CI currently runs 10.9.8).@aossie-org/thrubox-clientwas manually bootstrap-published to create the package for the first time (npm has no "pending publisher" support for brand-new packages).AOSSIE-Org, repoThruBox-Client, workflowversion-release.yml, allowed actionnpm publish). Until that's set up, this workflow will fail since it no longer supplies a token.NPMJS_TOKENsecret can be removed.Checklist
Summary by CodeRabbit