Skip to content

Commit

Permalink
chore: migrations renamed or deleted fail on migration-order GH action (
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelromcar-parabol authored Nov 26, 2024
1 parent b783f55 commit 9dc1877
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/migration-order.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ jobs:
uses: tj-actions/changed-files@v41
with:
files: packages/server/postgres/migrations/*.ts
output_renamed_files_as_deleted_and_added: "true"

- name: Check migration conflicts
- name: Check migration conflicts and renamed or deleted files
run: |
for file in ${{ steps.new-migrations.outputs.added_files }}; do
FILE_NAME=$(basename $file)
Expand All @@ -37,3 +38,11 @@ jobs:
echo "$FILE_NAME does not conflict with existing migrations on master"
fi
done
if ${{ steps.new-migrations.outputs.any_deleted }}; then
echo "${{ steps.new-migrations.outputs.deleted_files_count }} migration files where renamed or deleted. Please put their original names back or restore the following files:"
for file in ${{ steps.new-migrations.outputs.deleted_files }}; do
echo $(basename $file)
done
exit 1
fi

0 comments on commit 9dc1877

Please sign in to comment.