Skip to content

Set up npm trusted publishing (OIDC) release workflows - #318

Merged
ksinder merged 1 commit into
mainfrom
ksinder-trusted-publishing
Jun 17, 2026
Merged

Set up npm trusted publishing (OIDC) release workflows#318
ksinder merged 1 commit into
mainfrom
ksinder-trusted-publishing

Conversation

@ksinder

@ksinder ksinder commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Description

Publishing is currently fully manual — there's no release workflow, so cutting a version means someone runs npm publish locally with a personal token, and (because there's no prepublishOnly guard) it's easy to ship a stale bin/cli.mjs bundle. This adds automated release tooling mirroring notion-sdk-js, using npm OIDC trusted publishing (no long-lived NPM_TOKEN in CI) with build provenance.

What's added

  • .github/workflows/publish.yml — on push to main (and manual dispatch): npm ci → build → test → npm publish --provenance via OIDC (skips if the version already exists), then pushes a vX.Y.Z tag for Bump version to commits. The artifact (bin/cli.mjs) is rebuilt in CI so it can't go stale.
  • .github/workflows/increment-version.yml — manual workflow to bump the version and open a Bump version to vX.Y.Z PR.
  • RELEASING.md — the release flow + the one-time npm-side setup (configure makenotion/notion-mcp-server + publish.yml as a Trusted Publisher on npmjs.com) that's required before the first automated publish.

⚠️ Prerequisite before merging is "live"

The npm trusted-publisher must be configured on npmjs.com (org admin) per RELEASING.md, or the publish step will fail with an auth error. Until then, the manual fallback in RELEASING.md still works.

Security

Workflow inputs/commit-message values are passed via env: and never interpolated into run: shells (no command-injection surface); the only use of head_commit.message is inside an if: expression.

How was this change tested?

  • Automated test — workflow YAML (CI changes can't fully run until merged to main; logic mirrors the proven notion-sdk-js workflows).
  • Manual review — adapted for this repo (no lint script; build emits the bundled CLI).

🤖 Generated with Claude Code

Publishing was fully manual (no release workflow), which risks shipping a
stale bundle and relies on a personal npm token. Mirror the notion-sdk-js
setup:

- publish.yml: on push to main (and manual dispatch), build + test, then
  `npm publish --provenance` via OIDC trusted publishing (no NPM_TOKEN),
  skipping if the version already exists, and push a vX.Y.Z tag for
  "Bump version to" commits.
- increment-version.yml: manual workflow to bump the version and open a
  "Bump version to vX.Y.Z" PR.
- RELEASING.md: documents the flow and the one-time npm-side trusted
  publisher setup that must be configured before the first automated publish.

Workflow inputs/commit-message values are passed via env vars, never
interpolated into run: shells.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ksinder ksinder mentioned this pull request Jun 17, 2026
2 tasks
@ksinder
ksinder requested review from hallie and vshen-notion June 17, 2026 21:30
@ksinder
ksinder marked this pull request as ready for review June 17, 2026 21:31
@ksinder
ksinder merged commit d282ce9 into main Jun 17, 2026
9 checks passed
@ksinder
ksinder deleted the ksinder-trusted-publishing branch June 17, 2026 22:09
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