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
Airflow Integration
Orchestrate with Airflow
dbt Integration
Add gates to dbt workflows
CLI Reference
Full CLI documentation
API Reference
Full API documentation
