Sign inSign up

nhalstead00/validate-json-action

By nhalstead00

•Updated about 4 years ago

Image
0

4.1K

nhalstead00/validate-json-action repository overview

Created by Icons8 Icon

⁠Validate JSON Github Action

Easy to use GitHub Action to validates JSON files based on a JSON Schema.

This project uses ajv⁠, fast JSON schema validator, to perform the validation.

⁠Usage

⁠Inputs
  • 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 (separated by commas) of the JSON files to validate with the schema provided. Glob paths can be used as well (wildcard matching).

Note: schema is required, otherwise default will be used.

⁠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:

name: Validate JSONs

on: [pull_request]

jobs:
  verify-json-validation:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: Validate JSON with Glob
        uses: nhalstead/[email protected]
        with:
          schema: /path/to/schema.json
          jsons: /path/to/file.json,/path/to/another/file.json
⁠Other People using this GitHub Action

GitHub Search⁠

Tag summary

Content type

Image

Digest

sha256:f99bacb55…

Size

50.7 MB

Last updated

about 4 years ago

docker pull nhalstead00/validate-json-action