Scheduled patrols and CI
Where it runs
DataRanger reads from Snowflake, dbt models, DuckDB and files, and runs from the command line, a GitHub Action or an AI agent. Whatever the source, a patrol is three SELECT statements: nothing is written back.
To run it on a schedule, see the GitHub Actions example and the Airflow DAG example.
GitHub Action
Run a patrol in CI, after a load or on a schedule. The action writes the result to the job summary, uploads the report, and fails the job when an incident needs a person.
- uses: akshaysharma1088/dataranger@v0.9.0
with:
snowflake: "true"
table: ANALYTICS.GOLD.PAYMENTS
ref-table: ANALYTICS.GOLD.CUSTOMERS
manifest-table: ANALYTICS.OPS.CONTROL_TOTALS
key: payment_id
date: booking_date
days: "45"
env:
SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
SNOWFLAKE_USER: ${{ secrets.SNOWFLAKE_USER }}
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
SNOWFLAKE_ROLE: READER
SNOWFLAKE_WAREHOUSE: XS
After dbt build, one line is enough when the mapping is in the model's meta block:
- uses: akshaysharma1088/dataranger@v0.9.0
with:
dbt-model: fct_payments
The same inputs work for DuckDB (db, table, ref-table, manifest-table) and files (facts-file, ref-file, manifest-file). Set fail-on-escalate: "false" to report without failing. The outputs incidents, auto-fixed, no-action, escalate and report are available to later steps. All inputs are listed in action.yml.
Airflow
Use the daily patrol DAG example. Begin with a read-only connection and review generated reports before considering changes to production workflows.