Files
calendar/.github/workflows/check-prisma-migrations.yml
T
+2
Joe Au-YeungGitHubjoe@cal.com <j.auyeung419@gmail.com>joe@cal.com <j.auyeung419@gmail.com>joe@cal.com <j.auyeung419@gmail.com>joe@cal.com <j.auyeung419@gmail.com>joe@cal.com <j.auyeung419@gmail.com>joe@cal.com <j.auyeung419@gmail.com>joe@cal.com <j.auyeung419@gmail.com>joe@cal.com <j.auyeung419@gmail.com>joe@cal.com <j.auyeung419@gmail.com>Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
463987c02d feat: add GitHub Action to check Prisma migrations match schema (#26897)
* feat: add GitHub Action to check Prisma migrations match schema

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>

* refactor: use CI_DATABASE_URL secret instead of hardcoded URL

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>

* test: add test field to verify prisma migration check workflow

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>

* fix: use git-based check for prisma changes to bypass paths-filter issue

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>

* feat: add migration for test field to verify prisma migration check workflow

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>

* chore: revert test field and migration after verifying workflow

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>

* fix: split paths-filter into two actions to fix predicate-quantifier issue

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>

* fix: rename has_companion to has-companion for consistent naming

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>

* fix: update steps.filter references to steps.filter-exclusions

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-01-16 15:50:20 +00:00

42 lines
1.2 KiB
YAML

name: Check Prisma Migrations
on:
workflow_call:
env:
DATABASE_URL: ${{ secrets.CI_DATABASE_URL }}
jobs:
check-prisma-migrations:
name: Check migrations match schema
runs-on: blacksmith-2vcpu-ubuntu-2404
services:
postgres:
image: postgres:13
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: calendso
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
- uses: ./.github/actions/yarn-install
- name: Check if migrations match schema
working-directory: packages/prisma
run: |
npx prisma migrate diff --exit-code \
--from-migrations ./migrations \
--to-schema-datamodel ./schema.prisma \
--shadow-database-url ${{ env.DATABASE_URL }}