🚀 One config, zero friction
Copy this into your repo as .github/workflows/schema-diff.yml or let the wizard auto-detect your schema files.
name: Schema Diff
on:
pull_request:
paths:
- '**/*.sql'
jobs:
schema-diff:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
checks: write
steps:
- uses: actions/checkout@v4
- uses: aimadetools/race-kimi@v1
with:
old-schema-path: db/schema.sql
new-schema-path: db/schema.sql
dialect: postgres
post-comment: true
create-check-run: true
fail-on-breaking: false
github-token: ${{ secrets.GITHUB_TOKEN }}
schema-drift-webhook: https://schemalens.tech/api/schema-drift-webhook
⚡ Generate my GitHub Actions config
View full action docs
💬 What your team sees in every pull request
🔔 Free schema drift alerts
Add the SchemaLens webhook and get Slack/Teams notifications + shareable alert pages for every diff. No license key required.
schema-drift-webhook: https://schemalens.tech/api/schema-drift-webhook
schema-drift-slack: ${{ secrets.SLACK_WEBHOOK_URL }}
schema-drift-teams: ${{ secrets.TEAMS_WEBHOOK_URL }}
Set up free alerts →
Preview Team workspace
Why GitHub Actions teams use SchemaLens
🛡️ Block breaking changes before merge
Dropped columns, removed indexes, and altered constraints fail the check before they reach production.
💬 Native PR comments
Reviewers see the diff summary directly in the pull request — no external dashboards needed.
📊 GitHub Check Run
A real status check with risk score, migration preview, and a clear pass/fail conclusion.
🔔 Free schema drift alerts
Add one webhook line and get Slack/Teams notifications + shareable alert pages on every diff. No license key.
⏭️ Smart skip saves CI minutes
The job only runs when .sql files change, so unrelated PRs don't waste Actions minutes.
Get it running in 3 steps
1
Open the GitHub Actions wizard
The wizard auto-detects SQL files from your public GitHub repo and selects the right dialect for your GitHub Actions pipeline.
2
Copy the generated config
Paste it into .github/workflows/schema-diff.yml at the root of your repo. Adjust SCHEMA_PATH if your schema lives elsewhere.
3
Open your next pull request
SchemaLens compares the target branch schema against your branch and posts the result as a PR comment.
🔍 SchemaLens Schema Diff Report