GitHub Action
Validate JSON
0.1.0
Latest version
A GitHub Action that validates JSON files based on a JSON Schema.
This project uses ajv
, fast JSON schema validator, to perform the validation.
schema
: Relative file path under the repository of a JSON schema file to validate the other JSON files with. Default is:'./schema.json'
.jsons
: One or more relative file paths under the repository (seperated by comma) of the JSON files to validate with the schema provided.
Note:
schema
is required, otherwise default will be used.
invalid
: One or more of relative file paths of the invalid JSON files, found in the repository (seperated by comma).
An example .github/workflows/validate.yml
workflow to run JSON validation on the repository:
name: Validate JSONs
on: [pull_request]
jobs:
verify-json-validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Validate JSON
uses: docker://orrosenblatt/validate-json-action:latest
env:
INPUT_SCHEMA: /path/to/schema.json
INPUT_JSONS: /path/to/file.json,/path/to/another/file.json
- Initial validation action
- Docker
- Automate release process
- Github workflow screenshots
- Support
exclude
&include
in PRs (JSONs from pattern) - Support
schema
&jsons
by external reference (from S3/GitHub/etc...) - Support
delimiter
input