ci(release): publish to npm via trusted publishing (OIDC) - #105
Conversation
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe release-please workflow now upgrades npm before publishing, updates the publish comments for trusted publishing, and makes the package publish step skip versions that are already published. ChangesWorkflow Publish Update
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
The publish job failed with npm E404 because it published unauthenticated (no NODE_AUTH_TOKEN; setup-node's placeholder token). Switch to npm Trusted Publishing instead of a long-lived token: - upgrade npm to >= 11.5.1 (OIDC support) after setup-node - drop NODE_AUTH_TOKEN and the --provenance flag; with the GitHub Actions OIDC environment (id-token: write) npm authenticates via the per-package Trusted Publisher on npmjs.com and generates provenance automatically Requires a Trusted Publisher configured on npmjs.com for each @pleaseai/code* package (repo pleaseai/code-intelligence, workflow file release-please.yml).
dfd1588 to
0a9cf4c
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/release-please.yml (1)
82-84: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winPin the npm upgrade version instead of
latest.
npm install -g npm@latestfloats to whatever is newest at run time, which can introduce unvetted/breaking npm CLI behavior into the release pipeline without warning. Since trusted publishing only requires npm ≥ 11.5.1, pin to a known-good version to keep the publish job reproducible. This aligns with the zizmor warning about ad-hoc package installs outside a lockfile.Proposed fix
- name: Upgrade npm for trusted publishing - run: npm install -g npm@latest + run: npm install -g npm@11.6.0🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/release-please.yml around lines 82 - 84, The release workflow’s npm upgrade step uses a floating `latest` install, which makes the publish job non-reproducible and can pull in unvetted CLI changes. Update the `Upgrade npm for trusted publishing` step in the workflow to install a specific known-good npm version that satisfies the trusted publishing requirement (npm >= 11.5.1), keeping the `setup-node`/publish flow stable and predictable.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/release-please.yml:
- Around line 82-84: The release workflow’s npm upgrade step uses a floating
`latest` install, which makes the publish job non-reproducible and can pull in
unvetted CLI changes. Update the `Upgrade npm for trusted publishing` step in
the workflow to install a specific known-good npm version that satisfies the
trusted publishing requirement (npm >= 11.5.1), keeping the `setup-node`/publish
flow stable and predictable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b3eeb978-90c6-49be-be1b-b55fc007101b
📒 Files selected for processing (1)
.github/workflows/release-please.yml
…ions) A partial publish left @pleaseai/code-darwin-arm64@0.1.14 on npm while the other 7 packages stayed at 0.1.13. Re-running aborted on the first package with 'cannot publish over previous version', never reaching the missing ones. Check npm view per package and publish only versions not yet present.
|



Summary
The
publishjob failed with npm E404 because it published unauthenticated — the step never setNODE_AUTH_TOKEN, soactions/setup-nodeleft its placeholder token (XXXXX-XXXXX-XXXXX-XXXXX) in.npmrcand the registry rejected the PUT to the existing@pleaseai/code*packages. (Provenance signing succeeded via OIDC; only the registry auth was missing.)Rather than wire a long-lived
NPM_TOKEN, switch to npm Trusted Publishing (OIDC) — no stored npm token, automatic provenance.Changes (
.github/workflows/release-please.yml, publish job)setup-node(npm install -g npm@latest) — required for OIDC trusted publishing.NODE_AUTH_TOKEN— withid-token: write(already set) npm detects the GitHub Actions OIDC environment and authenticates via the per-package Trusted Publisher on npmjs.com.--provenance— provenance is generated automatically under trusted publishing.Trusted Publishing is configured per package. For each of these 8 packages → Settings → Trusted Publisher → GitHub Actions:
pleaseaicode-intelligencerelease-please.yml(filename only — not the full path)npm publishPackages:
@pleaseai/code,@pleaseai/code-darwin-arm64,@pleaseai/code-darwin-x64,@pleaseai/code-linux-x64-glibc,@pleaseai/code-linux-arm64-glibc,@pleaseai/code-linux-x64-musl,@pleaseai/code-linux-arm64-musl,@pleaseai/code-win32-x64After merge + npm setup
@pleaseai/code-v0.1.14is already tagged, sorelease_createdwon't fire again. Re-run publishing:Requirements confirmed against npm docs: npm ≥ 11.5.1, Node ≥ 22.14.0,
id-token: write, noNODE_AUTH_TOKEN, automatic provenance.Summary by CodeRabbit