Expand description
Semantic exit codes for CI/CD integration
This module defines standardized exit codes that allow CI/CD pipelines to programmatically handle different error conditions. Exit codes follow Unix conventions (0 = success, non-zero = error) with specific meanings.
§Exit Code Ranges
| Range | Category |
|---|---|
| 0 | Success |
| 1-9 | General errors |
| 10-19 | Security issues |
| 20-29 | Configuration errors |
| 30-39 | I/O and resource errors |
| 40-49 | Validation errors |
§CI/CD Usage
# In a CI pipeline
infiniloom embed /path/to/repo --security-check
exit_code=$?
case $exit_code in
0) echo "Success" ;;
10) echo "Secrets detected - blocking PR" ;;
11) echo "PII detected - review required" ;;
12) echo "License violation - legal review needed" ;;
*) echo "Error: $exit_code" ;;
esac§GitHub Actions Integration
- name: Security Scan
id: scan
run: infiniloom embed . --security-check
continue-on-error: true
- name: Block on Secrets
if: steps.scan.outcome == 'failure' && steps.scan.exit-code == 10
run: |
echo "::error::Secrets detected in codebase"
exit 1
- name: Warn on PII
if: steps.scan.exit-code == 11
run: echo "::warning::PII detected - review recommended"Structs§
- Exit
Result - Result type that can be converted to an exit code
Enums§
- Exit
Code - Semantic exit codes for CLI commands
- Exit
Code Category - Categories of exit codes
Traits§
- ToExit
Code - Helper trait to convert errors to exit codes