Skip to content

Commit 58bbad6

Browse files
committed
Use npm trusted publishing (OIDC) - no token needed
1 parent 8808ca8 commit 58bbad6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

.github/workflows/publish.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
- 'package.json'
88
workflow_dispatch:
99

10+
permissions:
11+
id-token: write # Required for OIDC trusted publishing
12+
contents: write
13+
1014
jobs:
1115
check-version:
1216
runs-on: ubuntu-latest
@@ -46,11 +50,6 @@ jobs:
4650
needs: check-version
4751
if: needs.check-version.outputs.should_publish == 'true'
4852
runs-on: ubuntu-latest
49-
permissions:
50-
contents: write
51-
environment:
52-
name: npm
53-
url: https://www.npmjs.com/package/@xdevplatform/xdk
5453
steps:
5554
- uses: actions/checkout@v4
5655

@@ -59,14 +58,15 @@ jobs:
5958
node-version: '20'
6059
registry-url: 'https://registry.npmjs.org'
6160

61+
- name: Update npm for trusted publishing
62+
run: npm install -g npm@latest
63+
6264
- run: npm ci
6365
- run: npm run build
6466
- run: npm test
6567

66-
- name: Publish
68+
- name: Publish (trusted publishing via OIDC)
6769
run: npm publish
68-
env:
69-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
7070

7171
- name: Create tag
7272
run: |

0 commit comments

Comments
 (0)