forked from different-ai/openwork
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 1.21 KB
/
Copy pathden-db-check.yml
File metadata and controls
45 lines (36 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Den DB Check
on:
pull_request:
paths:
- "ee/packages/den-db/**"
permissions:
contents: read
jobs:
migrations-in-sync:
name: Schema and migrations in sync
runs-on: blacksmith-4vcpu-ubuntu-2204
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 11.4.0
- name: Install dependencies
run: pnpm install --filter "@openwork-ee/den-db..."
- name: Generate migrations from schema
run: pnpm --filter @openwork-ee/den-db db:generate
- name: Fail if schema changed without a committed migration
run: |
set -euo pipefail
changes="$(git status --porcelain -- ee/packages/den-db/drizzle)"
if [ -n "$changes" ]; then
echo "$changes"
echo "::error::Schema changed without a committed migration. Run 'pnpm --filter @openwork-ee/den-db db:generate' locally and commit the generated files in ee/packages/den-db/drizzle."
exit 1
fi
echo "Migrations are in sync with the schema."