Skip to content

Commit 3ee9979

Browse files
committed
build: added trusted publishing
1 parent 0eeb4f9 commit 3ee9979

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,20 @@ on:
1010
repository_dispatch:
1111
types: [ release ]
1212

13+
permissions:
14+
id-token: write
15+
1316
jobs:
1417
release:
1518
runs-on: ubuntu-latest
1619
strategy:
1720
matrix:
1821
node-version: ["lts/*"]
19-
22+
permissions:
23+
contents: write # to be able to publish a GitHub release
24+
issues: write # to be able to comment on released issues
25+
pull-requests: write # to be able to comment on released pull requests
26+
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
2027
steps:
2128
- uses: actions/checkout@v6
2229

@@ -41,14 +48,12 @@ jobs:
4148
if: "env.ENABLE_RELEASE == 'true' && ! contains('refs/heads/build ', github.ref)"
4249
env:
4350
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4551
run: pnpm semantic-release
4652

4753
- name: Release Dry Run
4854
if: "env.ENABLE_RELEASE != 'true' || contains('refs/heads/build ', github.ref)"
4955
env:
5056
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5257
run: pnpm semantic-release --dry-run
5358

5459
- run: echo "env.ENABLE_RELEASE is ${{ env.ENABLE_RELEASE == 'true' }} and branch is ${{ github.ref }}, no release can be published." && exit 1

0 commit comments

Comments
 (0)