Skip to content

Commit 7e943bd

Browse files
committed
ci: publish to npm via OIDC trusted publishing
The npm publish step used the NPM_TOKEN secret, which is invalid (404 on PUT). With trusted publishing configured on the npm side, publish directly with --provenance: grant the job id-token: write so npm can exchange a GitHub OIDC token for a registry token.
1 parent c11695f commit 7e943bd

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66

77
name: Create a release
88

9+
permissions:
10+
contents: write
11+
id-token: write
12+
913
jobs:
1014
build:
1115
name: Create a release
@@ -78,8 +82,4 @@ jobs:
7882
asset_label: all versions, including non-minified javascript
7983
asset_content_type: application/zip
8084
- name: publish the package to NPM
81-
run: |
82-
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
83-
npm publish
84-
env:
85-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
85+
run: npm publish --provenance

0 commit comments

Comments
 (0)