Skip to content

Commit ed0ecc2

Browse files
committed
fix(release): upgrade npm for the OIDC token exchange
The first v1.4.7 run died with ENEEDAUTH: pnpm delegates the actual tarball upload to the npm CLI, and the trusted-publishing OIDC exchange happens in that subprocess — Node 22's bundled npm 10.x predates the feature entirely. Install npm ^11.5.1 before publishing. Also drop setup-node's registry-url (and the empty NODE_AUTH_TOKEN): its generated .npmrc auth placeholder is exactly the config trusted publishing wants absent.
1 parent 8f12664 commit ed0ecc2

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,14 @@ jobs:
3939
- name: Setup pnpm
4040
uses: pnpm/action-setup@v4
4141

42+
# No registry-url: with trusted publishing there is no auth token, and
43+
# registry-url would write an .npmrc with an unresolved ${NODE_AUTH_TOKEN}
44+
# placeholder that interferes with the OIDC flow.
4245
- name: Setup Node
4346
uses: actions/setup-node@v4
4447
with:
4548
node-version: '22'
4649
cache: pnpm
47-
registry-url: 'https://registry.npmjs.org'
4850

4951
- name: Install dependencies
5052
run: pnpm install --frozen-lockfile
@@ -79,10 +81,11 @@ jobs:
7981
- name: Test
8082
run: pnpm -r test
8183

82-
# setup-node's registry-url writes an .npmrc with a ${NODE_AUTH_TOKEN}
83-
# placeholder; export it empty so nothing trips on the unresolved var
84-
# (pnpm ≥11.1.3 tolerates it, the empty env makes it explicit).
84+
# pnpm delegates the actual upload to the npm CLI, and the OIDC token
85+
# exchange happens there — npm 10.x (bundled with Node 22) predates
86+
# trusted publishing and dies with ENEEDAUTH.
87+
- name: Upgrade npm (OIDC exchange needs ≥ 11.5.1)
88+
run: npm install -g npm@^11.5.1 && npm --version
89+
8590
- name: Publish to npm (OIDC trusted publishing + provenance)
8691
run: npx -y pnpm@^11.1.3 publish -r --access public --no-git-checks
87-
env:
88-
NODE_AUTH_TOKEN: ''

0 commit comments

Comments
 (0)