Github Action to Lint Iglu JSON Schemas
name: Iglu Lint Review
on: [pull_request]
jobs:
iglulint:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v2
- name: iglulint
uses: mrchief/[email protected] # or any tagged release
with:
path_to_schemas: "path/to/schema"
github_token: ${{ secrets.github_token }}
For a complete list of options, see action.yml
It can currently validate:
- if your schema is valid JSON or not
- if valid, then run it against
igluctl lint
to further check for errors and inconsistencies against Iglu Schema Registries
Errors are posted as review comments. Some examples are:
JSON Lint errors
Igluctl lint errors
-
This action relies on underlying tools jsonlint and igluctl to perform the actual validations. As such, the actual error messages are only as useful as what the tool provides.
E.g. in the JSON Lint Error screenshot, the problem is an extra trailing comma but the error message from the tool is not so helpful in identifying that.
-
Igluctl lint doesn't provide the line numbers of the offending code. This action performs a crude implmentation to figure out the line number. As such, the comments may sometime be placed against incorrect line numbers. If that happens, please feel free to report an issue here. I can not guarantee it can be fixed but I'll definitely try. PRs would be welcome too!
-
jsonlint doesn't report all errors at once, so you may have to make multiple passes if your JSON Schema file contains multiple errors.
[X] - Do not report multiple comments on subsequent runs. Fixed in v1.1.0
We welcome all kind of contributions, as long as they are not violating our Code of Conduct. You can contribute by:
- reporting a bug (submit one here)
- proposing new feature (submit one here)
- submitting new features or bug fixes (send a PR)
By contributing, you agree that your contributions will be licensed under the project's license
We use Github Flow method so please follow these steps:
- Fork the repo and create your branch from master.
- If you've added code that should be tested, add tests.
- If you've changed APIs, update the documentation.
- Issue that pull request!
NOTE: Ensure that you merge the latest from "upstream" before making a pull request!
Please see CODE_OF_CONDUCT.md
This action is released under Apache License 2.0. Docker container images built in this project include third party materials. See THIRD_PARTY_NOTICE.md for details.