xataio / pgroll

PostgreSQL zero-downtime migrations made easy
https://www.xata.io
Apache License 2.0
3.56k stars 67 forks source link

Add CI step to validate examples against the JSON schema #301

Closed andrew-farries closed 8 months ago

andrew-farries commented 8 months ago

Add a CI step to validate that the example migrations are valid according to the JSON schema.

This would have caught the problem where the JSON schema was not fully updated in https://github.com/xataio/pgroll/pull/293 and had to be updated in a follow-up PR https://github.com/xataio/pgroll/pull/300 despite #293 including an example migration.

Use ajv-cli to perform schema validation.

Here is an example run where the check fails.