Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
feather

GitHub Action

Iglu Schema Lint

v1.0.0

Iglu Schema Lint

feather

Iglu Schema Lint

Validate Iglu JSON Schemas for syntax errors

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Iglu Schema Lint

uses: mrchief/[email protected]

Learn more about this action in mrchief/iglu-lint-action

Choose a version

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.

  • Currently, this action doesn't prevent duplicate comments on multiple runs, or reruns of your workflow. In other words, if you have an error for file A and you make more changes to your PR without fixing file A, then subsequent runs will post another comment for file A. Fixing this is on the roadmap and PRs are welcome.

Roadmap

[ ] - Do not report multiple comments on subsequent runs.

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.