GitHub Actions Integration
Integrate Code Pathfinder directly into your GitHub workflows for automated security scanning on every push and pull request.
PR Comments & Inline Findings
Quick Start
Add this workflow to .github/workflows/security-scan.yml:
Version Pinning
@v2.0.2 for stability. Using @main may introduce breaking changes.Configuration Options
All inputs are optional except you must specify either rules or ruleset. The ruleset input accepts comma-separated values.
| Input | Description | Default |
|---|---|---|
| rules | Path to local Python SDK rules file or directory | — |
| ruleset | Remote ruleset(s) from codepathfinder.dev/registry. Comma-separated for multiple. | — |
| project | Path to source code to scan | . |
| skip-tests | Skip scanning test files (test_*.py, *_test.py, etc.) | true |
| output | Output format: sarif, json, or csv | sarif |
| output-file | Output file path | pathfinder-results.sarif |
| fail-on | Fail build on severities: critical, high, medium, low (comma-separated) | — |
| no-diff | Disable diff-aware scanning and scan all files | false |
| verbose | Show statistics and timing information | false |
| debug | Show detailed debug diagnostics with timestamps | false |
| refresh-rules | Force refresh of cached rulesets | false |
| pr-comment | Post a summary comment on the pull request with scan results | false |
| pr-inline | Post inline review comments for critical/high severity findings | false |
| github-token | GitHub token for posting PR comments. Required when pr-comment or pr-inline is enabled. | — |
| disable-metrics | Disable anonymous usage metrics collection | false |
| python-version | Python version used to install the action | 3.12 |
Common Use Cases
Python Security
Scan Python projects for vulnerabilities:
Docker Security
Scan Dockerfiles and docker-compose files:
Custom Rules
Use your own security rules written with the Python SDK:
Block on Critical Findings
Fail the workflow if critical or high severity issues are found:
GitHub Code Scanning Integration
Upload SARIF results to GitHub Advanced Security for security alerts, code annotations, and vulnerability tracking.
SARIF Upload
if: always() to ensure SARIF uploads even when the scan finds vulnerabilities and exits with code 1. This provides visibility in GitHub's Security tab regardless of scan outcome.PR Comments & Inline Findings
Code Pathfinder can post a summary comment and inline review annotations directly on pull requests — no GHAS subscription needed. Enable pr-comment and/or pr-inline with a GitHub token:
Troubleshooting
No vulnerabilities detected
Enable debug and verbose output to see what is being scanned:
Scan full codebase instead of changed files
By default, diff-aware scanning only scans changed files. Disable it to scan everything:
Scans timing out
Scan a specific subdirectory to reduce scope:
Cache issues with remote rulesets
Force refresh cached rulesets:
Security Considerations
The GitHub Action implements defense-in-depth against command injection:
- All user inputs are validated before execution
- Dangerous shell metacharacters are blocked
- Bash arrays with proper quoting prevent injection
- No use of
eval,source, or code evaluation
Version pinning prevents supply chain attacks: