Skip to content

Commit fdbb6ff

Browse files
committed
chore: enable npm trusted publishing
1 parent 70d6b1b commit fdbb6ff

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# This action will publish the package to npm and create a GitHub release.
2+
# Ref: https://docs.npmjs.com/trusted-publishers/
23
name: Release
34

45
on:
@@ -16,27 +17,32 @@ permissions:
1617
jobs:
1718
publish:
1819
runs-on: ubuntu-latest
20+
environment: npm
1921
steps:
2022
- name: Checkout
2123
uses: actions/checkout@v4
2224

23-
- name: Install Pnpm
24-
run: npm i -g corepack@latest --force && corepack enable
25-
2625
- name: Setup Node.js
2726
uses: actions/setup-node@v4
2827
with:
2928
node-version: 22
30-
cache: "pnpm"
29+
30+
# Update npm to the latest version to enable OIDC
31+
# Use corepack to install pnpm
32+
- name: Setup Package Managers
33+
run: |
34+
npm install -g npm@latest
35+
npm --version
36+
npm install -g corepack@latest --force
37+
corepack enable
3138
3239
- name: Install Dependencies
3340
run: pnpm install
3441

3542
- name: Publish
3643
uses: JS-DevTools/npm-publish@v3
3744
with:
38-
token: ${{ secrets.NPM_TOKEN }}
39-
provenance: true
45+
token: empty
4046

4147
- name: Create GitHub Release
4248
uses: ncipollo/release-action@v1

0 commit comments

Comments
 (0)