We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7404f30 commit 536c324Copy full SHA for 536c324
.github/workflows/build-and-publish.yaml
@@ -34,7 +34,17 @@ jobs:
34
- name: Install Dependencies
35
run: npm ci
36
37
+ - name: Check if tests exist
38
+ id: check_tests
39
+ run: |
40
+ if grep -q '"test":' package.json && [ "$(npm pkg get scripts.test)" != '{}' ] && [ "$(npm pkg get scripts.test)" != 'null' ]; then
41
+ echo "has_tests=true" >> $GITHUB_OUTPUT
42
+ else
43
+ echo "has_tests=false" >> $GITHUB_OUTPUT
44
+ fi
45
+
46
- name: Run tests
47
+ if: steps.check_tests.outputs.has_tests == 'true'
48
run: npm test
49
50
build_and_publish:
0 commit comments