Skip to content

Commit ef95407

Browse files
committed
Update the workflow to use trusted publishing
1 parent f540a81 commit ef95407

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/publish.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
default: false
1414
description: Dry run
1515

16+
permissions:
17+
id-token: write # Required for OIDC (Trusted Publishing)
18+
contents: read
1619

1720
jobs:
1821
publish:
@@ -26,10 +29,14 @@ jobs:
2629
- name: Setup Node.js
2730
uses: actions/setup-node@v4
2831
with:
29-
node-version: '18'
32+
node-version: '24'
3033
cache: 'npm'
3134
registry-url: 'https://registry.npmjs.org'
3235

36+
# npm version 11.5.1 or later is required to use Trusted Publishing
37+
- name: NPM Version
38+
run: npm --version
39+
3340
- name: Install dependencies
3441
run: npm ci
3542

@@ -58,11 +65,10 @@ jobs:
5865
5966
- name: Publish to NPM
6067
env:
61-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6268
DRY_RUN: "${{ inputs.dry-run }}"
6369
run: |
6470
if [ "$DRY_RUN" = true ]; then
65-
echo "npm publish --dry-run"
71+
npm publish --dry-run
6672
else
67-
echo "npm publish"
73+
npm publish
6874
fi

0 commit comments

Comments
 (0)