Skip to main content
Integrate AnomalyArmor into your GitHub Actions workflows to automatically run data quality checks on pull requests, scheduled jobs, or deployments.

Prerequisites

  • AnomalyArmor account with connected data source
  • GitHub repository
  • API key stored as a GitHub secret

Setup

1. Create API Key

Generate an API key in Settings > API Keys with read-only scope (or read-write if you need to trigger checks).

2. Add Secret to GitHub

Go to your repository’s Settings > Secrets and variables > Actions and add:
  • Name: ARMOR_API_KEY
  • Value: aa_live_your_key_here

Basic Workflow

Add this workflow file to .github/workflows/data-quality.yml:

Workflow Patterns

Pattern 1: Pre-deployment Gate

Block deployments if data quality checks fail:

Pattern 2: Scheduled Quality Report

Generate a daily quality report:

Pattern 3: PR Comment with Quality Status

Post quality status as a PR comment:

Pattern 4: dbt + Quality Checks

Combine dbt runs with quality validation:

Pattern 5: Python Script for Complex Logic

For complex quality gates, use a Python script:
Create scripts/quality_gate.py:

Environment Variables

Reference these in your workflows:

Using GitHub Variables

Store non-sensitive config as repository variables:
  1. Go to Settings > Secrets and variables > Actions
  2. Click Variables tab
  3. Add variables like ASSET_ID, CRITICAL_TABLES, etc.
Reference in workflows:

Best Practices

1. Use Secrets for API Keys

Never hardcode API keys:

2. Fail Fast

Put quality checks early in workflows:

3. Cache Dependencies

Speed up workflows by caching:

4. Use Job Summaries

Write results to $GITHUB_STEP_SUMMARY for visibility:

5. Set Timeouts

Prevent hanging jobs:

Troubleshooting

”Command not found: armor”

Ensure you’ve installed the CLI before using it:

“Authentication failed”

Check that:
  1. ARMOR_API_KEY secret is set correctly
  2. The secret name matches your workflow reference
  3. API key hasn’t been revoked

Workflow not triggering

Check your on: triggers and branch patterns match your setup.

Next Steps

Common Questions

How do I store my AnomalyArmor API key in GitHub Actions?

Add it as a repository or organization secret: Settings → Secrets and variables → Actions → New repository secret, name it ARMOR_API_KEY, and paste the key value. Reference it in your workflow as ${{ secrets.ARMOR_API_KEY }}. For org-wide pipelines, use an org-level secret scoped to specific repos.

Can I fail a pull request on a data quality check failure?

Yes. Add an AnomalyArmor freshness or validity check as a required status check on the branch protection rule for main. The workflow exits non-zero when a check fails, GitHub marks the PR as failing, and merge is blocked until the check passes or is overridden.

Can I run AnomalyArmor checks on a schedule from GitHub Actions?

Yes. Use a workflow_dispatch trigger plus a schedule: cron entry. But most customers skip this - AnomalyArmor’s own scheduled monitoring and native alert destinations handle recurring checks without GitHub Actions runner time. Use GitHub Actions specifically for PR-time gates and deploy-time validation.

Is there an official AnomalyArmor GitHub Action?

Not yet as a Marketplace action - a run: step that installs the CLI (pip install anomalyarmor-cli) or calls REST directly via curl is the current pattern. A dedicated action is on the roadmap. See the examples in this page for the canonical shape.

Airflow Integration

Orchestrate with Airflow

dbt Integration

Add gates to dbt workflows

CLI Reference

Full CLI documentation

API Reference

Full API documentation