Skip to content

Commit b9f2914

Browse files
committed
ci: fix npm publish OIDC (omit registry-url placeholder token)
setup-node with registry-url injects a dummy NODE_AUTH_TOKEN when unset, so npm publish used that instead of trusted publishing and returned 404. Use Node 22 + npm >=11.5.1 per npm trusted publishing requirements. Made-with: Cursor
1 parent 9a110c1 commit b9f2914

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/publish.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v6
1717

18+
# Omit registry-url: setup-node otherwise sets NODE_AUTH_TOKEN to a placeholder and npm publish uses that instead of OIDC.
1819
- name: Setup Node
19-
uses: actions/setup-node@v4
20+
uses: actions/setup-node@v6
2021
with:
21-
node-version: 20
22-
registry-url: https://registry.npmjs.org
22+
node-version: 22
23+
check-latest: true
2324
cache: npm
2425

26+
- name: Upgrade npm for trusted publishing (OIDC)
27+
run: npm install -g npm@">=11.5.1"
28+
2529
- name: Ensure versions match
2630
shell: bash
2731
run: |

0 commit comments

Comments
 (0)