Skip to content

chore(ci): switch npm publish to Trusted Publishing (OIDC)#1

Merged
yasha-dev1 merged 1 commit intomainfrom
chore/npm-trusted-publishing
Apr 26, 2026
Merged

chore(ci): switch npm publish to Trusted Publishing (OIDC)#1
yasha-dev1 merged 1 commit intomainfrom
chore/npm-trusted-publishing

Conversation

@yasha-dev1
Copy link
Copy Markdown
Collaborator

Summary

  • Drops NPM_TOKEN from the release workflow in favour of npm's OIDC-based Trusted Publishing — no long-lived secret to rotate or leak.
  • Adds --provenance --access public so published tarballs get a verifiable build attestation linking them to this workflow run.
  • Upgrades npm to @latest in the runner because Node 20 ships npm 10 and OIDC publish needs npm >= 11.5.

Required before this can publish

  1. On npmjs.com → harnext package → SettingsPublishing accessAdd trusted publisher:
    • Organization: QualityUnit
    • Repository: harnext
    • Workflow filename: release.yml
    • Environment: leave blank
  2. Delete the now-unused NPM_TOKEN repo secret.

Test plan

  • After merging + completing the npmjs.com setup, trigger the workflow manually with dry_run = true — exercises the OIDC handshake without uploading.
  • Then tag vX.Y.Z to do a real publish; verify the published version on npm shows the provenance badge.

🤖 Generated with Claude Code

Drops NPM_TOKEN in favour of npm's OIDC-based Trusted Publishing. The
workflow's id-token permission lets npm verify it was invoked by this
exact workflow on this exact repo, and provenance is attached to the
published tarball.

Requires a one-time setup on npmjs.com: package settings → Publishing
access → Add trusted publisher with org=QualityUnit, repo=harnext,
workflow=release.yml.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@yasha-dev1 yasha-dev1 merged commit 90cf49f into main Apr 26, 2026
2 checks passed
@yasha-dev1 yasha-dev1 deleted the chore/npm-trusted-publishing branch April 26, 2026 08:22
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