Skip to content

Commit 9e890b3

Browse files
committed
enable auth check before npm deployment
1 parent 493f574 commit 9e890b3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/publish.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ jobs:
3232
env:
3333
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
3434

35-
- name: Publish to NPM
36-
run: npm publish
35+
- name: Verify .npmrc and Publish
36+
run: |
37+
if grep -qE "_authToken=.{1,}" .npmrc; then
38+
npm publish
39+
else
40+
echo "Failed to create .npmrc file" && exit 1
41+
fi
3742
working-directory: ./npm
43+

0 commit comments

Comments
 (0)