add lint migration github action
This commit is contained in:
28
.github/workflows/lint-migrations.yml
vendored
Normal file
28
.github/workflows/lint-migrations.yml
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
name: Lint Migrations
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'packages/db/migrations/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'packages/db/migrations/**'
|
||||
|
||||
jobs:
|
||||
lint_migrations:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Find modified migrations
|
||||
run: |
|
||||
modified_migrations=$(git diff --diff-filter=d --name-only origin/$GITHUB_BASE_REF...origin/$GITHUB_HEAD_REF 'migrations/*.do.*.sql')
|
||||
echo "$modified_migrations"
|
||||
echo "::set-output name=file_names::$modified_migrations"
|
||||
id: modified-migrations
|
||||
- uses: sbdchd/squawk-action@v1
|
||||
with:
|
||||
pattern: ${{ steps.modified-migrations.outputs.file_names }}
|
||||
Reference in New Issue
Block a user