Overview
Geval uses standard exit codes that CI/CD systems can interpret to make automated decisions. This allows seamless integration with any CI/CD platform.Exit Code Reference
| Code | Status | Description | CI/CD Behavior |
|---|---|---|---|
0 | PASS | All evals passed contract requirements | ✅ Pipeline continues |
1 | BLOCK | Contract violated, release blocked | ❌ Pipeline fails, merge blocked |
2 | REQUIRES_APPROVAL | Approval needed to proceed | ⚠️ Pipeline fails, requires manual review |
3 | ERROR | Execution error | ❌ Pipeline fails, indicates system error |
Usage in CI/CD
GitHub Actions
GitHub Actions automatically interprets exit codes:GitLab CI
GitLab CI uses exit codes to determine job status:Custom Handling
You can handle exit codes explicitly:Status Meanings
PASS (0)
All evaluation rules passed. Safe to merge and deploy.BLOCK (1)
One or more rules failed. Do not merge or deploy.REQUIRES_APPROVAL (2)
Rules failed but configured to require approval instead of blocking.ERROR (3)
System error occurred (file not found, invalid contract, etc.).JSON Output
When using--json flag, exit codes still apply, but you also get structured output:
Best Practices
- Always check exit codes - Don’t ignore them in scripts
- Use JSON for automation - Parse structured output for custom handling
- Set appropriate actions - Use
blockfor critical,warnfor non-critical - Handle errors gracefully - Exit code 3 indicates configuration issues
- Document expectations - Make it clear what each exit code means in your CI/CD