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 withread-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:scripts/quality_gate.py:
Environment Variables
Reference these in your workflows:| Variable | Required | Description |
|---|---|---|
ARMOR_API_KEY | Yes | Your AnomalyArmor API key (store as secret) |
ASSET_ID | For some commands | Asset UUID (store as variable) |
Using GitHub Variables
Store non-sensitive config as repository variables:- Go to Settings > Secrets and variables > Actions
- Click Variables tab
- Add variables like
ASSET_ID,CRITICAL_TABLES, etc.
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:ARMOR_API_KEYsecret is set correctly- The secret name matches your workflow reference
- API key hasn’t been revoked
Workflow not triggering
Check youron: 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 itARMOR_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 formain. 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 aworkflow_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 - arun: 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
