Skip to content

Commit 2929c62

Browse files
authored
chore(CD): Release with OIDC trusted publishing (#5709)
* remove node token from publish job * specify release job permission scope
1 parent a23c346 commit 2929c62

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/publish-on-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ jobs:
3232
name: Publish to NPM
3333
needs: build
3434
runs-on: ubuntu-latest
35+
# https://docs.npmjs.com/trusted-publishers#step-2-configure-your-cicd-workflow
36+
permissions:
37+
contents: read # to enable reading the contents of the release for publishing
38+
id-token: write # to enable use of OIDC for npm provenance
3539
steps:
3640
- uses: actions/checkout@v6
3741
- uses: actions/setup-node@v6
@@ -40,12 +44,8 @@ jobs:
4044
registry-url: https://registry.npmjs.org/
4145
- if: ${{ !github.event.release.prerelease }}
4246
run: npm publish
43-
env:
44-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
4547
- if: ${{ github.event.release.prerelease }}
4648
run: npm publish --tag next
47-
env:
48-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
4949

5050
publish-assets:
5151
name: Publish to assets server

0 commit comments

Comments
 (0)