Skip to content

ci(release): drop setup-node registry-url so a failed OIDC exchange can't fall back to a placeholder token - #3

Closed
msanvarov wants to merge 1 commit into
mainfrom
ci/npm-oidc-no-placeholder-token
Closed

msanvarov wants to merge 1 commit into
mainfrom
ci/npm-oidc-no-placeholder-token

Conversation

@msanvarov

Copy link
Copy Markdown
Member

Why

The 0.2.0 publish (run 43247481012) failed with E404 Not Found - PUT https://registry.npmjs.org/@cleanlist-ai%2fcli. The package and the @cleanlist-ai scope both exist (0.1.0 was published by cleanlist-ai), so the 404 is an auth failure, not a missing package.

The real cause is on npmjs.com, not in this repo: no Trusted Publisher is configured for @cleanlist-ai/cli. The workflow already uses OIDC (id-token: write, npm 11, no NPM_TOKEN), but npm only accepts the OIDC token once that link exists. When the exchange fails, npm quietly falls back to the .npmrc that setup-node writes because of registry-url. That file uses NODE_AUTH_TOKEN, which is setup-node's placeholder XXXXX-XXXXX-XXXXX-XXXXX (visible in the log). npm then PUTs with a fake token and gets the misleading 404, plus the "tokens that bypass 2FA" notice.

What

  • Remove registry-url from setup-node in the publish job. OIDC doesn't need it, because npm's default registry is already registry.npmjs.org. A missing or mismatched Trusted Publisher now fails with ENEEDAUTH rather than a 404. It also removes the always-auth warnings.

This doesn't fix the 0.2.0 publish by itself. That needs the Trusted Publisher configured on npmjs.com (package Settings, then Trusted Publisher, then GitHub Actions: Cleanlist-ai / cleanlist-cli / release.yml, environment blank). After that, re-run the failed publish job of run 43247481012.

A ci: commit doesn't trigger a release, so merging this won't publish anything.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Chores
    • Updated the package publishing workflow to avoid misleading authentication errors when publishing credentials are unavailable. This does not change the published package or its public features.

The release workflow still sets up Node.js 24. It no longer sets an npm registry URL, and comments describe how this affects errors when an OIDC exchange fails.

Changes: Release publishing

Layer / File(s) Summary
Node.js setup for publishing
.github/workflows/release.yml
The workflow retains Node.js 24 setup and removes registry-url. Comments explain that omitting it avoids a placeholder token in .npmrc and that a failed OIDC exchange reports ENEEDAUTH instead of E404.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Bug fix

Merge Risk: Minimal · up to 1747a

This CI-only change makes a failed OIDC exchange report a clearer authentication error instead of a misleading 404. It does not trigger a release, and no merge-blocking risk is identified. The Trusted Publisher must still be configured on npmjs.com and the failed publish rerun.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: removing registry-url from setup-node in the release publish job so a failed OIDC exchange cannot fall back to a placeholder token. The raw summary confirms the workfl…
Description check Passed The description explains the failing 0.2.0 publish, the E404 error, the cause (no Trusted Publisher configured on npmjs.com), and the change that removes registry-url from setup-node. It also gives th…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: removing registry-url from setup-node in the release publish job so a failed OIDC exchange cannot fall back to a placeholder token. The raw summary confirms the workflow change in .github/workflows/release.yml matches this. The title is specific and accurate, though long at 106 characters.

Full details: Description check

Explanation

The description explains the failing 0.2.0 publish, the E404 error, the cause (no Trusted Publisher configured on npmjs.com), and the change that removes registry-url from setup-node. It also gives the remediation steps and notes that merging will not trigger a release. It relates directly to the changeset.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: 07e30ef6-ca29-46c4-8167-21f92cda2421
Commits

Reviewing files that changed from the base of the PR and between 75ee771 and 1747a7d.

Files selected for processing: 1

  • .github/workflows/release.yml

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

@msanvarov msanvarov closed this Nov 12, 2026
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