Exit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Runtime error |
2 | --fail-on threshold exceeded |
Using Exit Codes
In Scripts
vg scan
if [ $? -eq 2 ]; then
echo "Drift threshold exceeded"
exit 1
fi
In CI
Exit code 2 is returned when:
--fail-on errorand error findings exist--fail-on warnand warning findings exist--drift-budgetis exceeded--drift-worseningthreshold is exceeded
Example
vg scan --fail-on error || echo "Scan failed with code $?"