Skip to content

Commit 1f0b374

Browse files
authored
feat: trusted publishing of npm package (#355)
2 parents 94a8e60 + d3cff7c commit 1f0b374

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

.github/workflows/release.yaml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ on:
2121
type: string
2222
default: ""
2323

24+
permissions:
25+
id-token: write
26+
contents: write
27+
2428
concurrency:
2529
group: release
2630
cancel-in-progress: false
@@ -143,10 +147,7 @@ jobs:
143147
cache: 'npm'
144148
cache-dependency-path: 'package-lock.json'
145149
- name: Install dependencies
146-
run: |
147-
echo "access=public" >> .npmrc
148-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
149-
npm ci
150+
run: npm ci
150151
- name: Build module
151152
run: npm run build
152153
- name: Prepare MCPB package
@@ -215,16 +216,11 @@ jobs:
215216
node-version: 22
216217
cache: 'npm'
217218
cache-dependency-path: 'package-lock.json'
219+
registry-url: 'https://registry.npmjs.org'
220+
always-auth: 'true'
218221
- name: Install dependencies
219-
run: |
220-
echo "access=public" >> .npmrc
221-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
222-
npm ci
222+
run: npm ci
223223
- name: Build module
224224
run: npm run build
225225
- name: Publish to NPM
226226
run: npm publish --tag latest
227-
228-
env:
229-
NODE_AUTH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}
230-
NPM_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}

0 commit comments

Comments
 (0)