Skip to content

cdqag/action-validate-yaml

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Validate YAML

Composite action that validates a YAML file against JSON schema.

Under the hood it uses jsonschema CLI to perform the validation.

To specify the schema, you should use the yaml-language-server comment like this:

# yaml-language-server: $schema=[URI]
abc:
  def: ghi
klm:
  - nop
  - qrs

The URI can be a local file (e.g. some/path/to/schema.json) or a remote one (e.g. https://json.schemastore.org/github-workflow.json).

Tip

This comment syntax is created and supported by YAML Language Support by Red Hat VSCode extension, so you can get validation in your editor as well.

Usage

uses: cdqag/action-validate-yaml@v1
with:
  file: path/to/file.yaml

Inputs

Name Description Required Default
file Path to the YAML file to validate. Yes
schema JSON schema to validate against. If not provided, the action will try to extract it from the YAML file using the comment # yaml-language-server: $schema=URL. No empty string
schema-dialect JSON schema dialect. Only used if not provided in the schema. Value must have format: https://json-schema.org/[path]/schema No empty string

License

This project is licensed under the Apache-2.0 License. See the LICENSE file for details.

About

Action Validate YAML against JSON Schema

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages