Every time a developer changes a dbt model, there’s a question no one can easily answer before merging: is this safe to ship?Your dbt tests tell you if the code compiles. They don’t tell you if the model you just refactored has been failing tests for the past week, whether it feeds a dashboard your CEO looks at every morning, or whether there’s already an open incident on it that your data team is investigating.Elementary’s PR / MR Review answers all of that automatically. The moment a pull request touches your dbt models, a structured comment appears with everything your team needs to make a confident merge decision — without leaving the PR.
Data quality issues are exponentially cheaper to catch before merge than after. But today, most teams have no visibility into data health at review time — reviewers check the SQL, not the data. By the time a broken model hits production, it’s already in dashboards, downstream models, and stakeholder reports.Elementary closes that gap by bringing live data quality context directly into the code review workflow.
Step 2 — Add two repository secretsGo to Settings > Secrets and variables > Actions and add:
Secret
Description
ANTHROPIC_API_KEY
Your Anthropic API key
ELEMENTARY_API_KEY
Your Elementary Cloud API key
That’s it. The review only runs on PRs that touch files matching the path filter — other PRs are ignored entirely.
This works for pull requests opened from branches within the same repository. GitHub does not pass repository secrets to pull_request workflows triggered by forks or Dependabot.
Optional: customize the action
Input
Default
Description
models-path
models/
Path to your dbt models directory
diff-filter
ACMR
File changes to include: A=Added, C=Copied, M=Modified, R=Renamed
claude-model
claude-haiku-4-5-latest
Claude model to use. Switch to claude-sonnet-4-latest for deeper analysis on complex changes
base-ref
PR base branch
Branch to diff against
mcp-config-path
(auto-generated)
Path to a custom MCP config file. Only needed for self-hosted Elementary setups
Step 2 — Add two CI/CD variablesGo to Settings > CI/CD > Variables and add:
Variable
Masked
Description
ANTHROPIC_API_KEY
Yes
Your Anthropic API key
ELEMENTARY_API_KEY
Yes
Your Elementary Cloud API key
GitLab’s built-in CI_JOB_TOKEN is used to post the MR comment — no extra token setup needed.The review only runs on MRs that touch files matching the changes filter — other MRs are ignored entirely.
No comment appears after the job runsMake sure both contents: read and pull-requests: write are set under permissions in the workflow. An explicit permissions block sets any unlisted scope to none — omitting contents: read causes the checkout step to fail before Elementary runs.git diff returns no changed modelsMake sure fetch-depth: 0 is set on the checkout step. Without full git history the runner cannot compare branches and the diff will be empty.The comment says the MCP server is unreachableVerify ELEMENTARY_API_KEY is correctly set and the MCP server is enabled for your account. See the MCP setup guide.
If a model has never been synced through Elementary, the comment will note that no history is available yet. Results populate automatically after the next Elementary sync.
The review currently uses Claude via the Anthropic API. If your team uses a different provider and you’d like to see it supported, we’d love to hear from you — reach out at support@elementary-data.com or on the Community Slack.