Setting up the integration
Install CodeGate in your workflow
Add a step to install CodeGate globally before running the scan. Because CodeGate is published to npm, no additional authentication or registry configuration is required.
Run the scan with --no-tui
Use
--no-tui to disable the interactive terminal UI and interactive prompts. This flag is required in CI because there is no TTY and no user available to respond to prompts.--format sarif produces a SARIF 2.1.0 report that GitHub Code Scanning can ingest directly. --output writes the report to a file instead of stdout.Complete workflow examples
Workflow audit integration
The--workflow-audits flag enables the CI/CD audit pack, which scans GitHub Actions workflows, action definitions, and Dependabot configuration for risks that a standard file scan does not cover.
- Unpinned external action references (
uses: owner/repo@taginstead of a commit SHA) - High-risk triggers (
pull_request_target,workflow_run) - Overly broad permissions (
write-alland explicit write grants) - Template expression injection patterns in
runsteps and known sink inputs - Known vulnerable action references (requires
--runtime-mode online) - Dependabot cooldown and execution-risk checks
- Workflow hygiene issues such as missing concurrency gates, obfuscation, and unsafe conditional trust
--collect-kind:
Exit code handling in CI
CodeGate exits with a code that reflects the scan result. Use exit codes to decide whether a job should pass or fail.| Exit 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 |
2 as a blocking condition. GitHub Actions stops the job when any step exits with a non-zero code, so a codegate scan step that exits 2 fails the job automatically.
To distinguish between “findings below threshold” (exit code 1) and “findings at or above threshold” (exit code 2) in shell logic:
Using —format json for pipeline consumption
Use--format json when you want to process findings programmatically in your pipeline rather than uploading SARIF to GitHub Code Scanning.
Tips for CI environments
The
security-events: write permission is required on the GitHub Actions job to upload SARIF results to Code Scanning. Without it, the upload step will fail.