Skip to content

fix(release): isolate the post-publish verify step from the OIDC npmrc - #230

Merged
duguankui merged 1 commit into
mainfrom
fix/release-verify-step-npmrc
Sep 4, 2026
Merged

fix(release): isolate the post-publish verify step from the OIDC npmrc#230
duguankui merged 1 commit into
mainfrom
fix/release-verify-step-npmrc

Conversation

@duguankui

Copy link
Copy Markdown
Member

The v10.0.0-rc.14 release run (33875188525) failed at step 66, "Verify published packages install as a single copy each", with the same Failed to replace env in config: ${NODE_AUTH_TOKEN} yarn crash that broke v10.0.0-rc.12 and v10.0.0-rc.13 — five retries, all identical.

This time it happened after publishing: "Push tagged release to NuGet.org" and "Publish tagged Angular packages to npm" both succeeded, so rc.14 is fully published on both registries. What the failure cost was the draft GitHub Release (steps 67–68 skipped) and the single-copy check itself, which never actually ran.

Why rc.13's fix didn't cover this

rc.13 moved actions/setup-node's registry-url off the early Setup Node step onto a second setup-node call placed after the last yarn command in the job. That fixed every yarn command running before publishing. This step runs after publishing — downstream of that second call — and the .npmrc it generates stays exported as $NPM_CONFIG_USERCONFIG for the rest of the job. Yarn Classic expands every env-var placeholder in its resolved config on every invocation and throws when one is unset; nothing sets NODE_AUTH_TOKEN, because npm Trusted Publishing doesn't use it.

Fix

Run the step with an empty NPM_CONFIG_USERCONFIG of its own, the same isolation the GitHub Packages step already uses via --userconfig. The step installs published, public packages from npmjs and authenticates nothing, so it needs no registry config at all.

Verified by hand against the published set — node build/verify-npm-single-copy.mjs 10.0.0-rc.14 reports Yarn Classic resolving exactly one copy of each of the five @dignite packages, all at 10.0.0-rc.14. So rc.14 itself is sound; only the pipeline was broken.

Also

resolve-npm-dist-tag.mjs gains a docstring paragraph explaining why next is left behind while a pre-release holds latest (npm publish takes one --tag, and moving a second needs npm dist-tag add and a standing credential OIDC publishing deliberately does not provide). next has been moved to 10.0.0-rc.14 by hand for all five packages.

The v10.0.0-rc.14 run failed at "Verify published packages install as a
single copy each" with the same `Failed to replace env in config:
${NODE_AUTH_TOKEN}` yarn crash that broke rc.12 and rc.13 -- but after
publishing, so all 33 NuGet packages and all five Angular packages were
already out. The casualties were the draft GitHub Release (skipped) and
the single-copy check itself, which never ran.

rc.13's fix moved actions/setup-node's registry-url onto a second call
placed past the last yarn command in the job. This step runs after
publishing, so it sits downstream of that second call, and the .npmrc it
generates stays exported as $NPM_CONFIG_USERCONFIG for every remaining
step. Give the step an empty userconfig of its own -- it installs public
packages from npmjs and authenticates nothing.

Verified by hand against the published set: Yarn Classic resolves exactly
one copy of each of the five @dignite packages, all at 10.0.0-rc.14.

Also documents in resolve-npm-dist-tag.mjs why `next` is left behind while
a pre-release holds `latest`: npm publish takes one --tag, and moving a
second one needs `npm dist-tag add`, which needs a standing credential
OIDC publishing deliberately does not provide.
@github-actions github-actions Bot added documentation Improvements or additions to documentation area: build/ci Changes to build config, CI workflows, or shared repo-root config labels Sep 4, 2026
@duguankui
duguankui merged commit 23e3712 into main Sep 4, 2026
3 checks passed
@duguankui
duguankui deleted the fix/release-verify-step-npmrc branch September 4, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build/ci Changes to build config, CI workflows, or shared repo-root config documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant