Skip to content

fix: publish npm package with trusted publishing - #849

Merged
cjbell merged 2 commits into
mainfrom
cjbell-npm-trusted-publishing-5754
Jul 28, 2026
Merged

fix: publish npm package with trusted publishing#849
cjbell merged 2 commits into
mainfrom
cjbell-npm-trusted-publishing-5754

Conversation

@cjbell

@cjbell cjbell commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

Migrate the npm release job from a long-lived NPM_TOKEN to npm trusted publishing via GitHub Actions OIDC.

  • grant the publish job id-token: write and read-only repository contents
  • update all release jobs to current checkout and setup-node actions
  • install the latest npm 11 release before publishing so the CLI supports trusted publishing while retaining the package's npm shrinkwrap prepack lifecycle (removed in npm 12)
  • publish the public scoped package with npm instead of Yarn and remove NPM_TOKEN

The @knocklabs/cli package must have this repository and .github/workflows/on-release-created.yml registered as a trusted publisher in npm before the next release.

Validation

  • yarn run check
  • actionlint .github/workflows/on-release-created.yml
  • npx --yes npm@11 publish --dry-run --access public

Tasks

KNO-14497

Linear Issue: KNO-14497

Open in Web Open in Cursor 

Co-authored-by: Chris Bell <chris@cjbell.co>
@linear-code

linear-code Bot commented Jul 28, 2026

Copy link
Copy Markdown

KNO-14497

Co-authored-by: Chris Bell <chris@cjbell.co>
@cjbell
cjbell marked this pull request as ready for review July 28, 2026 22:39

cjbell commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Jul 28, 10:45 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 28, 10:45 PM UTC: @cjbell merged this pull request with Graphite.

@cjbell
cjbell merged commit cfe0822 into main Jul 28, 2026
7 checks passed
@cjbell
cjbell deleted the cjbell-npm-trusted-publishing-5754 branch July 28, 2026 22:45
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.

3 participants