Skip to content

Commit c2142a2

Browse files
committed
fix(actions): container format flag, checkov tuple parse, zap flag name
Three CI-breaking bugs: 1. scanner-container --format still space-separated (missed in prior fix) 2. Engine _run_in_container didn't handle checkov's parse_results returning a (findings, passed_count) tuple instead of a plain list 3. scanner-zap used --severity (invalid) instead of --severity-threshold, and set -euo pipefail caused early exit on unset vars
1 parent f2ff3e3 commit c2142a2

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

.github/actions/scanner-container/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ runs:
100100
python -m argus scan container \
101101
--image "$IMAGE_REF" \
102102
--scanners "$SCANNERS" \
103-
--format json markdown sarif \
103+
--format json --format markdown --format sarif \
104104
--output-dir "./$REPORT_DIR" \
105105
--no-timestamp \
106106
--severity-threshold "${FAIL_ON_SEVERITY:-none}" \

.github/actions/scanner-zap/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ runs:
121121
STARTUP_TIMEOUT: ${{ inputs.startup_timeout }}
122122
FAIL_ON_SEVERITY: ${{ inputs.fail_on_severity }}
123123
run: |
124-
set -euo pipefail
125124
mkdir -p zap-reports scanner-summaries
126125
127126
# SDK auto-discovers argus.yml if present; works without one too
@@ -155,7 +154,7 @@ runs:
155154
156155
# Pass severity threshold to SDK
157156
if [ "$FAIL_ON_SEVERITY" != "none" ]; then
158-
CMD="$CMD --severity $FAIL_ON_SEVERITY"
157+
CMD="$CMD --severity-threshold $FAIL_ON_SEVERITY"
159158
fi
160159
161160
# Run scan (exit code 1 = findings above threshold)

argus/core/engine.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,16 @@ def _run_in_container(
352352
)
353353

354354
findings = []
355+
metadata_extra = {}
355356
if result_files and hasattr(scanner, "parse_results"):
356-
findings = scanner.parse_results(result_files[0])
357+
parsed = scanner.parse_results(result_files[0])
358+
# parse_results may return a list or a (list, extra) tuple
359+
if isinstance(parsed, tuple):
360+
findings, extra = parsed
361+
if isinstance(extra, int):
362+
metadata_extra["passed_count"] = extra
363+
else:
364+
findings = parsed
357365
logger.debug(
358366
"Parsed %d finding(s) from %s",
359367
len(findings),
@@ -367,6 +375,7 @@ def _run_in_container(
367375
"execution": "container",
368376
"image": image,
369377
"digest": digest,
378+
**metadata_extra,
370379
},
371380
)
372381

0 commit comments

Comments
 (0)