Skip to content

Commit c2211f1

Browse files
Update publish.yml
1 parent c99393c commit c2211f1

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

.github/workflows/publish.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@ on:
44
branches:
55
- main
66

7+
permissions:
8+
contents: read
9+
id-token: write # required for npm trusted publisher (OIDC)
10+
711
jobs:
8-
build:
12+
publish:
913
runs-on: ubuntu-latest
10-
permissions:
11-
contents: read
12-
id-token: write # required for npm trusted publisher (OIDC)
1314
env:
1415
NODE_AUTH_TOKEN: "" # ensure we rely on OIDC, not a token
1516

1617
steps:
1718
- uses: actions/checkout@v4
1819
- uses: actions/setup-node@v4
1920
with:
20-
node-version: "20.x"
21+
node-version: "20"
2122
registry-url: "https://registry.npmjs.org"
22-
- name: Clean legacy npm auth config
23-
run: npm config delete //registry.npmjs.org/:_authToken || true
24-
23+
- name: Use latest npm (trusted publisher support)
24+
run: npm install -g npm@latest
2525
- run: npm ci
2626
- run: npm run build
2727

28-
# OIDC auth + provenance; no token needed when using trusted publishers
29-
- run: npm publish --provenance --access public
28+
# OIDC auth: no token needed when using trusted publishers
29+
- run: npm publish

0 commit comments

Comments
 (0)