Skip to content

ci: publish npm package with trusted OIDC - #13

Merged
mstuart merged 2 commits into
masterfrom
fix/npm-trusted-publishing
Aug 23, 2026
Merged

ci: publish npm package with trusted OIDC#13
mstuart merged 2 commits into
masterfrom
fix/npm-trusted-publishing

Conversation

@mstuart

@mstuart mstuart commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • grant only the npm publish job id-token: write
  • run publishing on Node 24 with actions/setup-node@v6, satisfying npm's trusted-publishing runtime requirement
  • disable package-manager caching in the release job
  • remove the NPM_TOKEN/NODE_AUTH_TOKEN publish credential

Verification

  • actionlint .github/workflows/release.yml
  • YAML parse and git diff --check
  • verified actions/setup-node@v6 resolves to an existing action tag
  • verified the published code-memory package exists and targets this repository
  • simulated the release version rewrite to 0.1.2; npm publish --dry-run --access public packaged successfully

Required npm setting

Before this workflow can publish, the code-memory package must have a GitHub Actions trusted publisher for mstuart/code-memory, workflow release.yml, with npm publish allowed. That registry-side authentication setting is intentionally not changed by this PR.

Grant the publish job an OIDC token, use a supported Node/npm runtime, and remove the long-lived NPM_TOKEN credential.
Pin each release action to the verified commit behind its existing ref and grant GITHUB_TOKEN permissions only to the job that needs them.
@mstuart
mstuart merged commit 1c23f2b into master Aug 23, 2026
3 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.

1 participant