Skip to content

Commit 7687112

Browse files
authored
Merge pull request #7 from nvsecurity/NV-4462-surface-scan-error
NV-4462 Surface the demo scan's error output on failure
2 parents 5629003 + 5c15c52 commit 7687112

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/nightvision.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,14 @@ jobs:
7878
7979
- name: (5) Scan the API
8080
run: |
81-
nightvision scan ${NIGHTVISION_TARGET} --auth ${NIGHTVISION_AUTH} > scan-results.txt
81+
# stdout is redirected to scan-results.txt (its first line feeds the export
82+
# below), which also swallows any scan error. Print the captured output and
83+
# fail explicitly so a scan failure is diagnosable instead of opaque. (NV-4462.)
84+
if ! nightvision scan ${NIGHTVISION_TARGET} --auth ${NIGHTVISION_AUTH} > scan-results.txt; then
85+
echo "nightvision scan failed; captured output:"
86+
cat scan-results.txt
87+
exit 1
88+
fi
8289
nightvision export sarif -s "$(head -n 1 scan-results.txt)" --swagger-file openapi-spec.yml
8390
8491
- name: (6) Upload SARIF file to GitHub Security Alerts if vulnerabilities are found

0 commit comments

Comments
 (0)