CI Integration¶
GitHub Actions¶
Basic (Fail on Drift)¶
This fails the CI job when drift is detected.
Skip Informational¶
SARIF (GitHub Code Scanning)¶
- uses: yunaremaia/driftcheck@main
with:
sarif: true
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: driftcheck.sarif
Markdown Summary¶
GitLab CI¶
driftcheck:
image: python:3.11
script:
- pip install git+https://github.com/yunaremaia/driftcheck.git
- driftcheck --no-informational
CircleCI¶
- run:
name: Drift Check
command: |
pip install git+https://github.com/yunaremaia/driftcheck.git
driftcheck --quiet
Pre-commit Hook¶
Add to .pre-commit-config.yaml:
repos:
- repo: https://github.com/yunaremaia/driftcheck
rev: v0.1.41
hooks:
- id: driftcheck
args: ["--no-informational"]
Install:
Local Hook (No pre-commit)¶
Make it executable:
Exit Codes¶
| Code | Meaning | CI Behavior |
|---|---|---|
| 0 | No drift | ✅ Pass |
| 1 | Drift detected | ❌ Fail |
| 2 | Error | ❌ Fail |
Pro Tips¶
- Use
--quietto suppress OK output in CI logs. - Use
--no-informationalto skip non-blocking drifts. - Use
--json > drifts.jsonfor machine-readable results you can parse in a later step. - Use
--sarifto surface drift alerts in the GitHub Security tab.