Skip to content

Commit 98b4de8

Browse files
authored
Enabled trusted publishing for npm packages
1 parent cc91e19 commit 98b4de8

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ on:
99
required: false
1010
type: boolean
1111
default: false
12+
13+
permissions:
14+
id-token: write # Required for OIDC
15+
contents: read
16+
1217
env:
1318
rootDir: ./packages/nextjs-cache-handler
1419
jobs:
@@ -20,22 +25,25 @@ jobs:
2025
steps:
2126
- name: Checkout code
2227
uses: actions/checkout@v4
28+
2329
- name: Copy README file to package directory
2430
run: |
2531
cp ../../README.md .
32+
2633
- uses: pnpm/action-setup@v4
34+
2735
- uses: actions/setup-node@v4
2836
with:
2937
cache: pnpm
3038
node-version: lts/*
3139
registry-url: "https://registry.npmjs.org"
40+
3241
- run: pnpm install --frozen-lockfile
42+
3343
- name: Publish to npm
3444
run: |
3545
if [ "${{ github.event.inputs.prerelease }}" == "true" ]; then
3646
npm publish --access public --tag next
3747
else
3848
npm publish --access public
3949
fi
40-
env:
41-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 commit comments

Comments
 (0)