Skip to content

Commit

Permalink
Only run if there are migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgliss committed Jun 25, 2024
1 parent 6ec89df commit 84fa058
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/lint-migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ jobs:
export DATABASE_CREDENTIALS="dispatch:dispatch"
export DISPATCH_ENCRYPTION_KEY="NJHDWDJ3PbHT8h"
export DISPATCH_JWT_SECRET="foo"
changed_files=$(git diff --name-only -- src/dispatch/database/revisions/tenant/versions)
if [ -z "$changed_files" ]; then
echo "No migration files changed, skipping linting"
exit 0
fi
dispatch database upgrade --revision-type tenant --sql
- name: Lint files
run: ./eugene lint --ignore E9 alembic_output.sql -f md --accept-failures > lint.md
Expand Down

0 comments on commit 84fa058

Please sign in to comment.