Skip to content

Commit 816676b

Browse files
authored
chore(ci): Use trusted publishing for NPM packages (#10236)
1 parent 1d7777d commit 816676b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
timeout-minutes: 30
1717
permissions:
1818
contents: write
19+
id-token: write # Required for OIDC trusted publishing
1920
steps:
2021
- name: Checkout
2122
uses: actions/checkout@v4
@@ -30,6 +31,9 @@ jobs:
3031
uses: actions/setup-node@v4
3132
with:
3233
node-version: 22.x
34+
registry-url: 'https://registry.npmjs.org/'
35+
- name: Upgrade npm for OIDC support
36+
run: npm install -g [email protected]
3337
- name: Get yarn cache directory path
3438
id: yarn-cache-dir-path
3539
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
@@ -59,10 +63,6 @@ jobs:
5963
run: yarn lerna run --concurrency 1 build
6064
env:
6165
NODE_OPTIONS: --max_old_space_size=4096
62-
- name: Set NPM token
63-
run: echo //registry.npmjs.org/:_authToken="$NPM_TOKEN" > ~/.npmrc
64-
env:
65-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6666
- name: NPM publish
6767
run: ./node_modules/.bin/lerna publish from-package --yes
6868

0 commit comments

Comments
 (0)