grantbirki/json-yaml-validate

A GitHub Action to quickly validate JSON and YAML files in a repository

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
github_tokenThe GitHub token used to create an authenticated client - Provided for you by default!no${{ github.token }}
modeThe mode to run the action in "warn" or "fail" - Default is "fail"nofail
commentWhether or not to comment on a PR with the validation results - "true" or "false" - Default is "false"nofalse
comment_on_successWhether or not to comment on a PR when all validation checks pass - "true" or "false" - Default is "false"nofalse
update_commentWhether or not to update an existing validation results PR comment authored by github-actions[bot] instead of creating a new one - "true" or "false" - Default is "false"nofalse
base_dirThe base directory to search for JSON and YAML files (e.g. ./src) - Default is "." which searches the entire repository. The directory must resolve inside the workspace.no.
filesList of file paths to validate. File paths may be newline-delimited or provided as a single space-separated line. Matched files must resolve to regular files inside the workspace.no""
schema_mappingsYAML list that maps JSON or YAML schema files to explicit file patterns for multi-schema validation.no""
use_inline_schemaWhether or not to use local inline JSON Schema references in JSON files and YAML language-server schema comments when YAML is validated as JSON - "true" or "false" - Default is "false"nofalse
use_dot_matchWhether or not to use dot-matching when searching for files - "true" or "false" - Default is "true" - If this is true, directories like .github, etc will be searchednotrue
json_schemaThe full path to the JSON schema file (e.g. ./schemas/schema.json) - Default is "" which doesn't enforce a strict schemano""
json_schema_versionThe version of the JSON schema to use - "draft-07", "draft-04", "draft-2019-09", "draft-2020-12"nodraft-07
json_extensionThe file extension for JSON files (e.g. .json) - Default is ".json"no.json
json_exclude_regexA regex to exclude JSON files from validation (e.g. .*\.schema\.json$) - Default is "" which doesn't exclude any filesno""
use_ajv_formatsWhether or not to use the AJV formats - "true" or "false"notrue
yaml_schemaThe full path to the YAML schema file (e.g. ./schemas/schema.yml) - Default is "" which doesn't enforce a strict schemano""
yaml_extensionThe file extension for YAML files (e.g. .yaml) - Default is ".yaml"no.yaml
yaml_extension_shortThe "short" file extension for YAML files (e.g. .yml) - Default is ".yml"no.yml
yaml_exclude_regexA regex to exclude YAML files from validation (e.g. .*\.schema\.yaml$) - Default is "" which doesn't exclude any filesno""
yaml_as_jsonWhether or not to treat and validate YAML files as JSON files - "true" or "false" - Default is "false". If this is true, the JSON schema will be used to validate YAML files. Any YAML schemas will be ignored. For this context, a YAML file is any file which matches the yaml_extension or yaml_extension_short inputs.nofalse
exclude_fileThe full path to a file in the repository where this Action is running that contains a list of '.gitignore'-style patterns to exclude files from validation (e.g. ./exclude.txt)no""
exclude_file_requiredWhether or not the exclude_file must exist if it is used. If this is true and the exclude_file does not exist, the Action will fail - "true" or "false" - Default is "true"notrue
use_gitignoreWhether or not to use the .gitignore file in the root of the repository to exclude files from validation - "true" or "false" - Default is "true"yestrue
git_ignore_pathThe full path to the .gitignore file to use if use_gitignore is set to "true" (e.g. ./src/.gitignore) - Default is ".gitignore" which uses the .gitignore file in the root of the repositoryno.gitignore
allow_multiple_documentsWhether or not to allow multiple documents in a single YAML file - "true" or "false" - Default is "true"notrue
ajv_strict_modeWhether or not to use strict mode for AJV - "true" or "false" - Default is "true"notrue
ajv_custom_regexp_formatsList of key value pairs of format_name=regexp. Each pair must be on a newline. (e.g. lowercase_chars=^[a-z]*$ )no""
namedescription
successWhether or not the validation was successful for all files - "true" or "false"