Overview
StackProbe is designed to run in CI/CD environments, helping you catch issues before they reach production. It exits with code 1 when checks fail, making it perfect for automated quality gates.Exit Code Behavior
StackProbe follows standard Unix conventions for exit codes:- Exit 0: All checks passed (or passed with warnings only)
- Exit 1: One or more checks failed
runner.ts:84:
status: "fail" will cause a non-zero exit. Warnings do not fail the build.
GitHub Actions
Basic Setup
Add StackProbe to your GitHub Actions workflow:With JSON Output
Capture structured output for further processing:Selective Checks
Run only specific checks in CI:Matrix Strategy
Run different checks across multiple jobs:GitLab CI
Basic Pipeline
With Artifacts
Multiple Jobs
Using —json Flag in CI
The--json flag outputs structured data perfect for CI processing:
JSON Output Structure
Processing JSON Output
Using —only Flag
Run specific checks for faster CI feedback:Configuration-Based CI
Usestackprobe.config.js for consistent CI behavior:
failOn configuration is defined in config.ts:7 but not yet fully implemented in the runner.
Failing on Warnings vs Errors
By default, StackProbe only fails the build on errors, not warnings. The configuration includes afailOn option:
- Only
status: "fail"causes exit code 1 status: "warn"displays warnings but exits 0- The
failOnconfig is loaded but not yet used in the exit logic
Performance Optimization
Cache Node Modules
GitHub Actions:Skip Slow Checks
Thecircular check can be slow on large codebases:
Troubleshooting
Permission Issues
If StackProbe fails to read files:Network Timeouts
Thedeps check fetches from npm registry. If CI has network issues:
Missing package.json
Some checks skip if files are missing:Best Practices
- Run early in pipeline - Catch issues before expensive build steps
- Use —only for speed - Run fast checks on every commit, full audit on PRs
- Save JSON output - Keep artifacts for historical analysis
- Don’t fail on warnings - Unless you’re ready to fix them all
- Cache dependencies - npm registry requests can be slow
- Set timeouts - Prevent hanging CI jobs