Skip to content

Commit 236838c

Browse files
authored
ci: publish npm package with trusted publisher (#3485)
No longer use a token to increase security.
1 parent 94ab74d commit 236838c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/publish-npm.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
build:
88
runs-on: ubuntu-24.04
99
permissions:
10-
id-token: write
10+
id-token: write # required for OIDC: trusted publisher and "npm provenance"
1111
contents: write # required to get token for "npm provenance" and to dispatch event
1212
steps:
1313
- name: Set VERSION
@@ -18,9 +18,9 @@ jobs:
1818
uses: ./.github/actions/build-setup
1919
with:
2020
registry-url: 'https://registry.npmjs.org'
21-
- run: npm publish --provenance --access public
22-
env:
23-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
21+
# no token used, use trusted publisher setup instead (https://docs.npmjs.com/trusted-publishers)
22+
- name: Publish to NPM
23+
run: npm publish --provenance --access public
2424
- name: Trigger workflows in charge of notifying other repositories
2525
uses: peter-evans/repository-dispatch@v4
2626
with:

0 commit comments

Comments
 (0)