Skip to content

Commit 3d396ab

Browse files
authored
chore(ci): use trusted publishing (npm) (#205)
Switch to using trusted publishing instead of granualar access token for npmjs publishing. https://docs.npmjs.com/trusted-publishers
1 parent 535d644 commit 3d396ab

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ jobs:
4141

4242
docker:
4343
name: Release on Docker Hub
44-
44+
permissions:
45+
contents: read
4546
needs:
4647
- release
4748

@@ -77,7 +78,9 @@ jobs:
7778

7879
npm:
7980
name: Release on NPM
80-
81+
permissions:
82+
contents: read
83+
id-token: write # OIDC for releasing on npm
8184
needs:
8285
- release
8386

@@ -99,12 +102,14 @@ jobs:
99102
cd packages/sync-engine
100103
pnpm version ${{ needs.release.outputs.new-release-version }} --no-git-tag-version
101104
105+
# Ensure npm 11.5.1 or later is installed for trusted publishing support
106+
- name: Update npm
107+
run: npm install -g npm@latest
108+
102109
- name: Publish sync-engine to npm
103110
run: |
104111
cd packages/sync-engine
105112
pnpm install --frozen-lockfile
106113
pnpm run build
107114
pnpm pack
108115
npm publish --access public
109-
env:
110-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)