Skip to content

mrchief/iglu-lint-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

iglu-lint

Github Action to Lint Iglu JSON Schemas

Usage

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

Validations

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

Review comments

Errors are posted as review comments. Some examples are:

JSON Lint errors

json lint errors

Igluctl lint errors

igluctl lint errors

Known issues

  • 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.

Roadmap

[X] - Do not report multiple comments on subsequent runs. Fixed in v1.1.0

Contributing

We welcome all kind of contributions, as long as they are not violating our Code of Conduct. You can contribute by:

By contributing, you agree that your contributions will be licensed under the project's license

Sending a PR

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!

Code of Conduct

Please see CODE_OF_CONDUCT.md

License

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.