Set up npm trusted publishing (OIDC) release workflows - #318
Merged
Conversation
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>
vshen-notion
approved these changes
Jun 17, 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.
Description
Publishing is currently fully manual — there's no release workflow, so cutting a version means someone runs
npm publishlocally with a personal token, and (because there's noprepublishOnlyguard) it's easy to ship a stalebin/cli.mjsbundle. This adds automated release tooling mirroringnotion-sdk-js, using npm OIDC trusted publishing (no long-livedNPM_TOKENin CI) with build provenance.What's added
.github/workflows/publish.yml— on push tomain(and manual dispatch):npm ci→ build → test →npm publish --provenancevia OIDC (skips if the version already exists), then pushes avX.Y.Ztag forBump version tocommits. 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 aBump version to vX.Y.ZPR.RELEASING.md— the release flow + the one-time npm-side setup (configuremakenotion/notion-mcp-server+publish.ymlas a Trusted Publisher on npmjs.com) that's required before the first automated publish.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 inRELEASING.mdstill works.Security
Workflow
inputs/commit-message values are passed viaenv:and never interpolated intorun:shells (no command-injection surface); the only use ofhead_commit.messageis inside anif:expression.How was this change tested?
main; logic mirrors the provennotion-sdk-jsworkflows).lintscript; build emits the bundled CLI).🤖 Generated with Claude Code