A GitHub Action that lints Prisma Migrations and/or flat-key i18n JSON files. Originally developed for SIDESTREAM.
format: The name of the migration folder matchesYYYYMMDDHHMMSS_YOUR_MIGRATION_NAMEdate: The date specified inside the migration name is not in the futuremissing: The migration folder contains amigration.sqlfilelink: The migration begins with a link to the PR it was added in:-- https://github.com/ORG/REPO/pull/NUMBERtransaction: The migration is wrapped with aBEGIN;andCOMMIT;transaction block
- Namespace conflicts: Detects keys that are both a leaf value and a namespace prefix (e.g.,
"expand"and"expand.all") - Invalid value types: Ensures all values in locale JSON files are strings (rejects numbers, booleans, arrays, null)
steps:
- uses: actions/checkout@v4
- name: Lint Prisma migrations
uses: sidestream-tech/lint-prisma-migrations@3.0.0
with:
prisma-migrations-path: ./prisma/migrations/
prisma-migrations-rules: |
format
date
missing
link
transaction
prisma-migrations-ignore: |
20260101000000_ignore_mesteps:
- uses: actions/checkout@v4
- name: Lint i18n files
uses: sidestream-tech/lint-prisma-migrations@3.0.0
with:
i18n-path: src/localessteps:
- uses: actions/checkout@v4
- name: Lint migrations and i18n
uses: sidestream-tech/lint-prisma-migrations@3.0.0
with:
prisma-migrations-path: ./prisma/migrations/
i18n-path: src/locales| Input | Required | Description |
|---|---|---|
prisma-migrations-path |
No | Path to the Prisma migrations directory |
prisma-migrations-ignore |
No | Migration names to ignore (multiline) |
prisma-migrations-rules |
No | Rules to enable (multiline). Default: all |
i18n-path |
No | Path to the i18n directory containing locale JSON files |
At least one of prisma-migrations-path or i18n-path must be provided.
| Output | Description |
|---|---|
prisma-migrations-files-analyzed |
Number of Prisma migration files analyzed |
i18n-files-analyzed |
Number of i18n JSON files analyzed |
v3 renames the inputs to support both linters:
| v2 | v3 |
|---|---|
path |
prisma-migrations-path |
ignore |
prisma-migrations-ignore |
rules |
prisma-migrations-rules |
pnpm install
pnpm test
pnpm build
pnpm packageThis action was inspired by https://github.com/batista/lint-filenames