check command with --policy enforces governance rules; audit export writes machine-readable compliance artifacts that downstream jobs, SIEM systems, and security scanners can consume.
GitHub Actions Policy Gate
Copy this workflow directly into.github/workflows/policy-gate.yml. It runs the policy check on every pull request, exports all report formats, and uploads them as a build artifact.
The
--no-verbose flag suppresses progress output, keeping CI logs clean. The if: always() on the export and upload steps ensures audit artifacts are written even when the policy check step fails.Add the policy file to your repository
Generate a policy template and commit it alongside your code:
Choose enforcement mode
Set
enforcement.mode in policy.yaml:audit— logs violations, exits0. Use this while iterating on policy rules.enforce— exits non-zero on blocking violations. Use this once your policy is stable.
Add the workflow file
Copy the GitHub Actions YAML above into
.github/workflows/policy-gate.yml and push. The gate runs automatically on every pull request.Audit Export Formats
Useaudit export to produce compliance evidence in any of three formats. All formats are written before a non-zero exit in enforce mode.
Export All Formats at Once
--format all honours reporting.formats in your policy file and falls back to json,csv,sarif if not configured.
SIEM Integration
The CSV format is designed for direct ingestion into log management and observability platforms:SARIF for Security Scanning
The SARIF format integrates with GitHub Advanced Security, GitLab SAST, and any tool that accepts the Static Analysis Results Interchange Format:github/codeql-action/upload-sarif action:
JSON for Pipeline Post-Processing
The JSON format is suitable for any pipeline job that needs to parse, filter, or forward compliance data programmatically:--no-verbose for Clean CI Output
Pass --no-verbose to any check, recommend, or audit export invocation to suppress progress banners, spinners, and decorative output. This keeps CI logs readable and avoids noise in artifact uploads:

