Skip to content

Commit 37543dc

Browse files
check NODE_AUTH_TOKEN is available or not (#1098)
Signed-off-by: msivasubramaniaan <msivasub@redhat.com>
1 parent b707580 commit 37543dc

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

.github/workflows/release.yaml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,24 @@ jobs:
4040
- name: Run Test
4141
run: yarn test
4242

43-
# Publish to npm
44-
- run: |
45-
yarn check-dependencies
46-
yarn publish --access public
43+
# Check dependencies
44+
- name: Run Check-Dependencies
45+
run: yarn check-dependencies
46+
47+
- name: Check if NODE_AUTH_TOKEN is present
48+
run: |
49+
if [ -z "$NODE_AUTH_TOKEN" ]; then
50+
echo "NODE_AUTH_TOKEN is empty"
51+
exit 1
52+
else
53+
echo "NODE_AUTH_TOKEN is set (but not printing it)"
54+
fi
55+
env:
56+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN}}
57+
58+
#Publish to npm
59+
- name: Publish to npm
60+
run: yarn publish --access public
4761
env:
4862
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
4963

0 commit comments

Comments
 (0)