https://github.com/nhalstead/validate-json-action
A Github action for validating JSON.
https://github.com/nhalstead/validate-json-action
gh-actions json-validation json-validator
Last synced: 9 days ago
JSON representation
A Github action for validating JSON.
- Host: GitHub
- URL: https://github.com/nhalstead/validate-json-action
- Owner: nhalstead
- License: mit
- Created: 2020-11-12T04:17:09.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-09T03:56:43.000Z (over 2 years ago)
- Last Synced: 2025-08-27T07:46:54.690Z (about 1 month ago)
- Topics: gh-actions, json-validation, json-validator
- Language: TypeScript
- Homepage:
- Size: 579 KB
- Stars: 7
- Watchers: 1
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
# Validate JSON Github Action
Easy to use GitHub Action to validate JSON files based on a JSON Schema.
This project uses [`ajv`](https://github.com/epoberezkin/ajv), fast JSON schema validator, to perform the validation.
## Usage
### Inputs
- `schema`: Relative file path in the repository to a JSON schema file to validate the other JSON files with. If no value is provided `./schema.json` will be used.
- `jsons`: One or more relative file paths under the repository (separated by commas) of the JSON files to validate with the schema provided. Glob paths can be used as well (wildcard matching).### Outputs
- `invalid`: One or more of relative file paths of the invalid JSON files, found in the repository (separated by commas).
### Example Workflow
An example `.github/workflows/validate.yml` workflow to run JSON validation on the repository:
```yaml
name: Validate JSONson: [pull_request]
jobs:
verify-json-validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Validate JSON with Glob
uses: nhalstead/validate-json-action@0.1.3
with:
schema: /path/to/schema.json
jsons: /path/to/file.json,/path/to/another/file.json
```### Other People using this GitHub Action
[GitHub Search](https://github.com/search?q=nhalstead%2Fvalidate-json-action+extension%3Ayml+extension%3Ayaml+path%3A.github%2Fworkflows+fork%3Atrue&type=Code&ref=advsearch&l=&l=)