Skip to content

Commit 489b345

Browse files
authored
fix: pin publish workflow npm to 11.10.1 (pre promise-retry removal) (#49)
Third attempt to unbreak the publish workflow. Supersedes #48's corepack approach which didn't actually activate (npm --version reported 10.9.7 post-activation, not 11.5.2), leaving all publishes running under the runner's bundled npm which pre-dates OIDC trusted publishing. Root cause of the original corruption: npm 11.11.0 (npm/cli#9008) removed `promise-retry`. Installing that version over the runner's bundled 10.9.x tree leaves orphan arborist files still requiring the module, producing MODULE_NOT_FOUND. v0.3.0 worked because that day's bundled npm was 10.9.4 — coincidentally different enough not to orphan. Pinning to 11.10.1 (last version before the removal, still >=11.5.0 for OIDC trusted publishing) avoids the boundary entirely.
1 parent 8cd793c commit 489b345

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

.github/workflows/publish.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,24 @@ jobs:
2121
with:
2222
node-version: 22
2323

24-
- name: Activate pinned npm via corepack for OIDC trusted publishing
25-
# npm's OIDC trusted publishing support requires npm >= 11.5.0, but the
26-
# runner's bundled npm (10.9.x) is older. Previously this step ran
27-
# `npm install -g npm@latest`, which self-corrupted on the runner's
28-
# prebuilt tree and produced MODULE_NOT_FOUND for promise-retry —
29-
# silently breaking every release since v0.3.1.
24+
- name: Upgrade npm to 11.10.1 for OIDC trusted publishing
25+
# OIDC trusted publishing (auto-auth via GitHub Actions id-token) is
26+
# supported from npm >= 11.5.0, so the runner's bundled npm (10.9.x)
27+
# is too old and must be upgraded.
3028
#
31-
# Corepack ships with Node 22 and installs package managers to its
32-
# own shim directory, sidestepping the self-upgrade corruption path
33-
# entirely. Pinning to a specific version stops tracking a moving
34-
# target that has historically shipped regressions.
29+
# Must be pinned below 11.11.0. In 11.11.0 (npm/cli#9008) the
30+
# `promise-retry` dep was replaced with `@gar/promise-retry`, and
31+
# installing that version over the runner's bundled 10.9.x tree
32+
# leaves orphaned arborist files still `require('promise-retry')`,
33+
# producing MODULE_NOT_FOUND and silently breaking every release
34+
# since v0.3.1. Pinning to 11.10.1 (last version with `promise-retry`)
35+
# avoids the removal boundary entirely.
36+
#
37+
# Corepack's `--activate` was tried (0837d45) but left the on-PATH
38+
# npm at the runner's bundled 10.9.7, so OIDC auth never engaged
39+
# and every publish failed with ENEEDAUTH.
3540
run: |
36-
corepack enable
37-
corepack prepare npm@11.5.2 --activate
41+
npm install -g npm@11.10.1
3842
npm --version
3943
4044
- name: Install dependencies

0 commit comments

Comments
 (0)