Skip to content

Commit 1365801

Browse files
committed
feat: handle diff
1 parent b9d8b6d commit 1365801

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,15 @@ jobs:
9494
echo "EOF" >> $GITHUB_OUTPUT
9595
- name: verify schema.sql is committed
9696
run: |
97+
# Save the original schema file
98+
cp migrations/schema-${{ env.PGMAJOR }}.sql migrations/schema-${{ env.PGMAJOR }}.sql.original
99+
100+
# Run dbmate-tool
97101
nix run github:supabase/postgres/${{ github.sha }}#dbmate-tool -- --version ${{ env.PGMAJOR }} --flake-url github:supabase/postgres/${{ github.sha }}
98-
if ! git diff --exit-code --quiet migrations/schema-${{ env.PGMAJOR }}.sql; then
102+
103+
# Compare the files
104+
if ! cmp -s migrations/schema-${{ env.PGMAJOR }}.sql migrations/schema-${{ env.PGMAJOR }}.sql.original; then
99105
echo "Detected changes in schema.sql:"
100-
git diff migrations/schema-${{ env.PGMAJOR }}.sql
106+
diff -u migrations/schema-${{ env.PGMAJOR }}.sql.original migrations/schema-${{ env.PGMAJOR }}.sql
101107
exit 1
102108
fi

0 commit comments

Comments
 (0)