Skip to content

ci: Publish through npm trusted publishing instead of a token - #3

Merged
rifont merged 1 commit into
mainfrom
ci/npm-trusted-publishing
Oct 3, 2026
Merged

rifont merged 1 commit into
mainfrom
ci/npm-trusted-publishing

Conversation

@rifont

@rifont rifont commented Oct 3, 2026 •

Copy link
Copy Markdown

Before: the manual Publish workflow needed an NPM_TOKEN secret.

After: npm trusts publish.yml in this repository over OIDC, so no token is stored. The workflow still runs only by hand from main.

How: pnpm packs the chosen package so workspace: ranges are rewritten, npm is updated to 11.5.1 or newer, and npm publish sends the tarball with an OIDC token and provenance. The trusted publisher binding for @taulabs/replicad (repository taucad/replicad, workflow publish.yml) is set once on npm with npm trust github.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AqCT91WnQNnHJQAQUyrXJt


Generated by Claude Code

Summary by CodeRabbit

  • Chores
    • Updated the package publishing workflow to use npm trusted publishing with provenance.
    • Publishing now supports the configured package and distribution tag through a generated package archive.

npm trusts this workflow over OIDC, so no NPM_TOKEN secret is stored. pnpm
packs the package so workspace ranges are rewritten, and npm 11.5.1 or newer
publishes the tarball with provenance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AqCT91WnQNnHJQAQUyrXJt
@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b455f94b-9a7e-40e5-a6c8-debfa807f2f0
📥 Commits

Reviewing files that changed from the base of the PR and between 856dcd7 and 9ec6c25.

📒 Files selected for processing (1)
  • .github/workflows/publish.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The publish workflow installs a supported npm version, packs the selected workspace package into a tarball, and publishes it with npm using OIDC trusted publishing.

Changes

npm package publishing

Layer / File(s) Summary
Configure npm trusted publishing
.github/workflows/publish.yml
The workflow description and job permission identify npm trusted publishing through OIDC. Node setup no longer sets the npm registry URL and now installs npm ^11.5.1 or newer.
Pack and publish the workspace package
.github/workflows/publish.yml
The workflow maps @taulabs/replicad to packages/replicad, packs the package, and publishes the tarball with public access and the selected dist-tag. The publish command no longer uses NODE_AUTH_TOKEN or an explicit provenance flag.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: claude

Merge Risk: ⚪ Minimal · up to 9ec6c

No actionable release-workflow issue remains in the supplied evidence; the change is mergeable after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 9ec6c

The change removes the publishing step’s use of a stored token while preserving manual execution, the main-branch gate, and the selected package. No introduced security defect was established, but npm’s external publisher binding and retirement of the old token remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The local release path targets one public package, whose consumers can inherit a compromised release. Maximum registry authority cannot be established without npm’s trusted-publisher configuration; local package selection is not proof of external authorization scope.

Trust Boundaries and Controls

  • inferred — npm becomes responsible for accepting the GitHub job identity instead of a supplied bearer token. Manual dispatch, main gating, and package mapping remain local controls. Dependency and build execution share the OIDC-enabled job, so the publishing trust boundary includes that execution chain, not only the final command.

Resilience and Maintainability Implications

  • inferred — Failures before the publish step prevent the normal release path from proceeding. Once the external publish request begins, registry reconciliation is needed for uncertain outcomes; the workflow does not serialize releases or provide automatic rollback, as in the prior design.

Hardening Proposals

  • proposed — Verify the npm publisher’s package, repository, workflow, and intended environment restrictions before release. After confirming successful OIDC publication and provenance, explicitly retire the old token wherever it remains valid.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: replacing token-based publishing with npm trusted publishing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rifont
rifont merged commit 94905cd into main Oct 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants