Skip to content

ci(release): fix the workspace reify that breaks trusted publishing - #445

Merged
ianwremmel merged 2 commits into
mainfrom
fix-release-workspace-reify-under-oidc
Sep 12, 2026
Merged

ci(release): fix the workspace reify that breaks trusted publishing#445
ianwremmel merged 2 commits into
mainfrom
fix-release-workspace-reify-under-oidc

Conversation

@ianwremmel-ai-agent

Copy link
Copy Markdown
Collaborator

The trusted publishing switch in #444 got the release job past npm auth, but
the next run died in prepare:

npm error code ETARGET
npm error notarget No matching version found for @code-like-a-carpenter/assert@2.4.1.
  at: npm version 3.6.1 --userconfig /tmp/120d47ff139d84a92ed936490954c498/.npmrc ...

@semantic-release/npm runs npm version with --userconfig pointed at a temp
file. On the token path set-npmrc-auth writes that file by concatenating every
npm config file it finds, ~/.npmrc included, which is how the job's
npm config set workspaces-update false reached it. Under trusted publishing
verify-auth returns before set-npmrc-auth, the temp file is never written,
and --userconfig pointed at a nonexistent path displaces ~/.npmrc.
workspaces-update reverts to its default of true, npm version reifies the
workspace, and the "*" ranges that multi-semantic-release just rewrote to this
run's unpublished versions fail to resolve.

Setting it as npm_config_workspaces_update instead puts it at npm's env config
level, which outranks every config file and is unaffected by --userconfig.

Also adds scripts/npm-trust, which registers GitHub Actions as the trusted
publisher for all 32 public workspace packages. npm stores that per package, so
this is a prerequisite for the OIDC exchange rather than an optimization, and a
new package will need a run of it (after one manual bootstrap publish, since the
registry will not configure a name that does not exist).

Nothing published and no tags were created in the failed run, so there is no
half-released state to unwind.

@semantic-release/npm runs `npm version` with --userconfig pointed at a temp
file. Under trusted publishing that file is never written, because the plugin
returns from verify-auth before it reaches set-npmrc-auth, so --userconfig
displaces ~/.npmrc and workspaces-update falls back to its default of true.
`npm version` then reifies the workspace against the "*" ranges that
multi-semantic-release has just rewritten to the versions this run intends to
publish, and dies with ETARGET on the first one the registry does not have yet.

Environment variables outrank every npm config file, so the setting survives
the --userconfig redirect.
npm attaches a trusted publisher to a single package, not to an org or a
scope, so each public workspace package needs its own configuration before
the release job's OIDC token exchange is accepted. scripts/npm-trust walks
the workspace and runs `npm trust github` for every one of them.

The registry refuses to configure a package that does not exist yet, so a
newly added package still needs one manual publish before the script can
cover it.
@nx-cloud

nx-cloud Bot commented Sep 12, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 5d843de

Command Status Duration Result
nx run-many --target build ✅ Succeeded 37s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-09-12 17:14:44 UTC

@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.90%. Comparing base (8f464cc) to head (5d843de).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #445      +/-   ##
==========================================
+ Coverage   60.78%   60.90%   +0.12%     
==========================================
  Files          29       29              
  Lines        1614     1614              
  Branches      369      369              
==========================================
+ Hits          981      983       +2     
+ Misses        629      627       -2     
  Partials        4        4              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ianwremmel
ianwremmel merged commit 5bbc03d into main Sep 12, 2026
31 of 32 checks passed
@ianwremmel
ianwremmel deleted the fix-release-workspace-reify-under-oidc branch September 12, 2026 17: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.

2 participants