Require OIDC for npm publication - #22
Conversation
Remove the obsolete persistent npm credential before the first ordinary release. Make the trusted-publisher identity, approval environment, toolchain, and secret-free workflow fail closed so authentication cannot fall back to a token.
|
Post-merge retrospective. Removing |
|
This PR deletes a secret, and understanding why that is an upgrade is core modern release security. The old way: a long-lived npm automation token lives in GitHub Actions secrets as The new way: OIDC trusted publishing. The workflow run authenticates to npm with a short-lived identity The two reinforcements are as instructive as the switch. The workflow pins the trusted context (exact If you publish gems or packages anywhere, this pattern (rubygems and npm both support trusted publishing) |
Summary
NODE_AUTH_TOKENand the persistent npm secret path from the publication jobnpmenvironment, OIDC permission, Node/npm toolchain, and singlenextpublish command@firstdraft.com/cli@0.1.0, API contract 0.2, progress behavior, thenextpublication channel, and the unchangedlatesttagVerification
v24.18.0and npm11.16.0checksnpm ci --ignore-scriptsnpm audit(0 vulnerabilities)npm run check(typecheck, lint, format, 150 tests, pack check, packed executable smoke)Release boundary
The protected release workflow now authenticates to npm only through its exact trusted-publisher relationship and a short-lived GitHub OIDC credential. Package-level token disallow remains optional defense-in-depth and is not claimed here. This pull request does not merge, create a release tag, publish npm, move
latest, or deploy anything.