| name: Validate migrations | |
| on: | |
| pull_request: | |
| paths: | |
| - 'priv/repo/migrations/**' | |
| - 'priv/ingest_repo/migrations/**' | |
| jobs: | |
| validate: | |
| name: App code does not change at the same time | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 | |
| id: changes | |
| with: | |
| list-files: json | |
| predicate-quantifier: 'every' | |
| filters: | | |
| lib: | |
| - 'lib/**' | |
| - '!lib/plausible/data_migration/**' | |
| - '!lib/plausible/migration_utils.ex' | |
| extra: | |
| - 'extra/**' | |
| config: | |
| - 'config/**' | |
| - if: steps.changes.outputs.lib == 'true' || steps.changes.outputs.extra == 'true' || steps.changes.outputs.config == 'true' | |
| run: | | |
| echo "::error file=${{ fromJSON(steps.changes.outputs.lib_files)[0] }}::Code and migrations shouldn't be changed at the same time" | |
| exit 1 | |