fix: use local .npmrc and add token presence check
All checks were successful
Deploy to Production / deploy (push) Successful in 4s
All checks were successful
Deploy to Production / deploy (push) Successful in 4s
This commit is contained in:
@@ -19,7 +19,11 @@ jobs:
|
||||
- run: npm run build
|
||||
- name: Publish to npm
|
||||
run: |
|
||||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
|
||||
if [ -z "${NPM_TOKEN}" ]; then
|
||||
echo "ERROR: NPM_TOKEN is empty! Check your Gitea Secrets."
|
||||
exit 1
|
||||
fi
|
||||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
|
||||
npm publish --access public
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
||||
|
||||
Reference in New Issue
Block a user