Skip to content

Commit e78c3bf

Browse files
authored
chore(npm): migrate to Trusted Publishing (#1021)
* ci(publish-release): use latest npm version * chore(npm): use Trusted Publishing
1 parent 43a2682 commit e78c3bf

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/publish-release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313

1414
permissions:
1515
contents: write
16+
id-token: write # OIDC for npm Trusted Publishing
1617
pull-requests: write
1718

1819
jobs:
@@ -39,12 +40,15 @@ jobs:
3940
node-version-file: ".nvmrc"
4041
package-manager-cache: false
4142

43+
# Ensure npm 11.5.1 or later for trusted publishing
44+
- name: Install latest npm
45+
if: ${{ github.event.inputs.force-npm-publish || steps.release.outputs.release_created }}
46+
run: npm install -g npm@latest
47+
4248
- name: Install
4349
if: ${{ github.event.inputs.force-npm-publish || steps.release.outputs.release_created }}
4450
run: npm ci
4551

4652
- name: Publish
4753
if: ${{ github.event.inputs.force-npm-publish || steps.release.outputs.release_created }}
48-
run: npm publish
49-
env:
50-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
54+
run: npm publish --access public --provenance

0 commit comments

Comments
 (0)