Exit code reference
| Code | Meaning |
|---|---|
0 | No unsuppressed findings |
1 | Findings exist, all below severity_threshold |
2 | One or more findings at or above severity_threshold |
3 | Scanner or runtime error |
Code 0 — No unsuppressed findings
The scan completed and found nothing above, at, or below the threshold that has not been suppressed. This is a clean result. Suppressed findings (viasuppress_findings or suppression_rules in config) do not affect the exit code. A scan with only suppressed findings exits 0.
Code 1 — Findings below threshold
Findings were detected, but none of them reach the configuredseverity_threshold. The default threshold is high, so a scan that finds only medium and low severity issues exits 1.
In codegate run mode, exit code 1 allows tool launch to proceed unless auto_proceed_below_threshold is false in config.
Code 2 — Findings at or above threshold
At least one finding matches or exceeds the configuredseverity_threshold. This is the blocking exit code. Use it to fail CI jobs and block deployments.
In codegate run mode, exit code 2 blocks the tool from launching.
Code 3 — Scanner or runtime error
CodeGate encountered an internal error before or during scanning. This is not a “no findings” result. Treat exit code3 as a pipeline failure and inspect the run log.
Relationship to severity_threshold
Theseverity_threshold configuration key determines the boundary between exit code 1 and exit code 2. It defaults to high.
info, low, medium, high, critical.
With the default high threshold:
- A
criticalorhighfinding → exit code2 - A
medium,low, orinfofinding (only) → exit code1
critical findings:
info:
~/.codegate/config.json (global) or <project>/.codegate.json (project-level). CLI flags do not override severity_threshold directly; adjust the config file or use suppression_rules to tune the effective signal.
Using exit codes in shell scripts
A minimal gate script:1 or 2):
Using exit codes in CI
In GitHub Actions, any step that exits with a non-zero code fails the job. Exit code2 fails the job automatically—no extra configuration needed.
if: always() on the upload step so SARIF results are published even when the scan exits 2.
To allow the pipeline to continue despite findings and only report:
Use
continue-on-error: true only for reporting-only pipelines. For blocking gates, omit it and let the exit code fail the job.