ci(npm): use trusted publishing (#20206)

* ci(npm): use trusted publishing

* ci: remove redundant npm installation

* ci: update GitHub Action user configuration for npm publish
This commit is contained in:
Tony 2025-11-27 10:05:41 +08:00 committed by GitHub
parent 411bf6e445
commit ec8afe2f00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 5 deletions

View File

@ -11,7 +11,7 @@ on:
- 'lib/**'
permissions:
id-token: write
id-token: write # Required for OIDC
jobs:
build:
@ -35,10 +35,8 @@ jobs:
run: pnpm rb
- name: Release
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
npx version-from-git --allow-same-version --template 'master.short'
- name: Publish to npmjs
run: pnpm publish --provenance --access public --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}