Skip to content

Commit 6718907

Browse files
committed
fix: update publish workflow for Node.js version and permissions
1 parent 17d9ad2 commit 6718907

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

.github/workflows/publish.yml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,24 @@ on:
55
types: [published]
66

77
permissions:
8-
id-token: write # Required for provenance
8+
id-token: write # Required for OIDC
99
contents: read
1010

1111
jobs:
1212
publish:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- name: Checkout code
16-
uses: actions/checkout@v5
15+
- uses: actions/checkout@v5
1716

18-
- name: Setup Node.js
19-
uses: actions/setup-node@v6
17+
- uses: actions/setup-node@v6
2018
with:
21-
node-version: '22'
19+
node-version: '20'
2220
registry-url: 'https://registry.npmjs.org'
2321

24-
- name: Install dependencies
25-
run: npm ci
26-
27-
- name: Run tests and build
28-
run: npm run prepublishOnly
29-
30-
- name: Publish to npm with provenance
31-
run: npm publish --provenance --access public
32-
env:
33-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
34-
22+
# Ensure npm 11.5.1 or later is installed
23+
- name: Update npm
24+
run: npm install -g npm@latest
25+
- run: npm ci
26+
- run: npm run build --if-present
27+
- run: npm test
28+
- run: npm publish

0 commit comments

Comments
 (0)