Skip to content

Commit e73eb3e

Browse files
authored
Move to npm trusted publishing (#4332)
1 parent 6346d36 commit e73eb3e

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

.github/workflows/npm.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ env:
1717
jobs:
1818
publish-npm-binaries:
1919
permissions:
20+
id-token: write # Required for trusted publishing
2021
contents: read
2122
packages: read
2223
runs-on: warp-ubuntu-latest-x64-2x
@@ -49,7 +50,7 @@ jobs:
4950

5051
- uses: actions/setup-node@v4
5152
with:
52-
node-version: "22.x"
53+
node-version: "24"
5354
registry-url: "https://registry.npmjs.org"
5455

5556
- name: "Download GitHub Artifacts"
@@ -97,10 +98,13 @@ jobs:
9798
npm publish --access public --tag "${tag}"
9899
popd || exit 1
99100
env:
100-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
101+
NODE_AUTH_TOKEN: ""
101102

102103
publish-npm-base:
103104
needs: publish-npm-binaries
105+
permissions:
106+
id-token: write # Required for trusted publishing
107+
contents: read
104108
runs-on: warp-ubuntu-latest-x64-2x
105109
strategy:
106110
matrix:
@@ -117,7 +121,7 @@ jobs:
117121

118122
- uses: actions/setup-node@v4
119123
with:
120-
node-version: "22.x"
124+
node-version: "24"
121125
registry-url: "https://registry.npmjs.org"
122126

123127
- name: Publish to npm
@@ -148,4 +152,4 @@ jobs:
148152
npm publish --access public --tag "${tag}"
149153
popd || exit 1
150154
env:
151-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
155+
NODE_AUTH_TOKEN: ""

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ jobs:
403403
# publish jobs get escalated permissions
404404
permissions:
405405
"contents": "read"
406+
"id-token": "write"
406407
"packages": "read"
407408

408409
custom-release-notes:

dist-workspace.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ pull-requests = "write"
4949
[dist.github-custom-job-permissions.npm]
5050
packages = "read"
5151
contents = "read"
52+
id-token = "write"
5253

5354
[dist.github-custom-job-permissions.helm]
5455
packages = "write"

0 commit comments

Comments
 (0)