Repository navigation
ci: stage npm releases for maintainer approval - #457
Conversation
The v4.0.1 PublishNpm job failed with E404 on PUT, and npm still lists 3.0.4 as latest. Drop NPM_TOKEN and let npm authenticate through the job's GitHub OIDC token (id-token: write is already granted). Refs #452 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019BJENnU8SXcDH2Tcx5EWE4
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #457 +/- ##
=======================================
Coverage 98.46% 98.46%
=======================================
Files 52 52
Lines 3057 3057
Branches 327 327
=======================================
Hits 3010 3010
Misses 46 46
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
gjbkz
left a comment
There was a problem hiding this comment.
Reviewed commit d50d74b49fb45f5ecde3320a6cf0cb3d9820f8a1.
No actionable issues found in the workflow change, subject to the explicitly documented npm-side Trusted Publisher setup.
The PublishNpm job retains id-token: write, runs on a GitHub-hosted Ubuntu runner, uses Node 26 with an npm version supporting Trusted Publishing, and publishes to the npm registry with provenance. Removing the explicit NPM_TOKEN binding is consistent with using OIDC authentication. The PR description identifies the required npm Trusted Publisher registration for organization nlibjs, repository typing, and workflow release.yml.
Validation: reviewed the complete release workflow and confirmed that the GitHub Actions test workflow for this commit passed. The release workflow itself was not executed during this review; npm-side publisher registration and a successful authenticated publish remain unverified. Configure the Trusted Publisher before the next release. This change does not itself republish the missing v4.0.1 version, and it does not establish the root cause of the historical E404.
docs/tasks/t001-npm-trusted-publishing/record.md is Codex's working log for this change, not project documentation, and it describes other repositories too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TzMPpMo8a7i9VCdJXWrKVb
The staged-publishing commit re-added docs/tasks/t001-npm-trusted-publishing/record.md, Codex's working log. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TzMPpMo8a7i9VCdJXWrKVb
The npm release workflow currently relies on a long-lived token or directly publishes packages. Use GitHub Actions OIDC to submit each npm release with
npm stage publish. A maintainer reviews the staged artifact and approves it with 2FA before it becomes publicly available; a successful Actions job alone no longer means the npm release is live.Grant the npm job
id-token: write/contents: read, remove the publish-stepNODE_AUTH_TOKEN, disable npm dependency caching, and install npm 11.21.0 explicitly (staged publishing requires npm >=11.15.0). Preserve build/package preparation, therelease: publishedtrigger, environment, and any JSR publishing job. JSR publishing remains automatic.Validation: actionlint passed for all five revised workflows. npm 11.21.0 recognizes the stage command, and
npm stage publish --dry-run --ignore-scripts --provenance=falsepassed against local artifact copies. Already-published versions were rejected, as expected; those copies used temporary prerelease versions with an explicit stage-check tag for validation. Repository versions and release tags were not changed. No package was uploaded, staged, or approved. OIDC/provenance still requires the actual GitHub Actions run. Previous build/test/pack validation is recorded in the task history.The owner reports npm Trusted Publisher configuration is complete with both
Allow npm publishandAllow npm dist-tagunchecked: GitHub Actions /nlibjs/typing/release.yml/ environment none. After merging and running a release, review the package under npmjs.com → Staged Packages → Approve and complete 2FA. Do not enable direct publish for this flow.Reference: https://docs.npmjs.com/staged-publishing/