Skip to content

Commit 898ad61

Browse files
committed
update the publish workflow for trusted publishers
1 parent c519617 commit 898ad61

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

.github/workflows/publish-npm.yaml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,10 @@ jobs:
2121
uses: actions/setup-node@v4
2222
with:
2323
node-version: 20
24+
registry-url: 'https://registry.npmjs.org'
25+
26+
- name: Update NPM
27+
run: npm install -g npm@latest
2428

2529
- name: Publish to NPM
26-
run: |
27-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
28-
if grep -qE "_authToken=.{1,}" .npmrc; then
29-
npm publish
30-
else
31-
echo "Failed to create .npmrc file" && exit 1
32-
fi
33-
env:
34-
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
30+
run: npm publish

0 commit comments

Comments
 (0)