Skip to content

Commit 465ada6

Browse files
authored
fix(ci): install an npm new enough for trusted publishing (#21)
npm performs the OIDC exchange itself and only gained that support in 11.5.1; Node 22 bundles npm 10.x, so npm publish ran unauthenticated and failed with ENEEDAUTH while the plugin reported the exchange succeeding.
1 parent 01690b6 commit 465ada6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ jobs:
4949
registry-url: https://registry.npmjs.org
5050
cache: 'pnpm'
5151

52+
# npm itself performs the OIDC token exchange for trusted publishing;
53+
# @semantic-release/npm only verifies that the exchange is possible and
54+
# then deliberately writes no auth to .npmrc. The npm bundled with Node
55+
# 22 is 10.x, which predates that support, so `npm publish` runs with no
56+
# credentials at all and fails with ENEEDAUTH. Trusted publishing landed
57+
# in npm 11.5.1.
58+
- name: Use an npm that supports trusted publishing
59+
run: |
60+
npm install -g npm@^11.5.1
61+
npm --version
62+
5263
- name: Install dependencies
5364
run: pnpm install --frozen-lockfile
5465

0 commit comments

Comments
 (0)