Skip to content

Commit 1001926

Browse files
committed
fix: update publishing workflow to use OIDC
1 parent 0c6fbd7 commit 1001926

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

.github/workflows/node.js.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
node-version: [12, 14, 16, 18, 20, 22]
13+
node-version: [12, 14, 16, 18, 20, 22, 24]
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v5
1616
- name: Use Node.js ${{ matrix.node-version }}
17-
uses: actions/setup-node@v4
17+
uses: actions/setup-node@v6
1818
with:
19+
cache: npm
1920
node-version: ${{ matrix.node-version }}
2021
- run: npm install
2122
- run: npm run lint

.github/workflows/npm-publish.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ on:
77
release:
88
types: [created]
99

10+
permissions:
11+
id-token: write # Required for OIDC
12+
contents: read
13+
1014
jobs:
1115
build:
1216
runs-on: ubuntu-latest
1317
steps:
14-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v5
1519
- uses: actions/setup-node@v4
1620
with:
21+
cache: npm
1722
node-version: latest
1823
- run: npm install
1924
- run: npm run lint
@@ -23,12 +28,11 @@ jobs:
2328
needs: build
2429
runs-on: ubuntu-latest
2530
steps:
26-
- uses: actions/checkout@v4
27-
- uses: actions/setup-node@v4
31+
- uses: actions/checkout@v5
32+
- uses: actions/setup-node@v6
2833
with:
34+
cache: npm
2935
node-version: latest
3036
registry-url: https://registry.npmjs.org/
3137
- run: npm install
3238
- run: npm publish
33-
env:
34-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 commit comments

Comments
 (0)