mirror of
https://github.com/brittonhayes/validate-yaml.git
synced 2024-11-23 13:40:57 -05:00
fix: updated readme to include usage instructions
This commit is contained in:
parent
ea9a13c9a8
commit
6fc4d63bf2
1 changed files with 36 additions and 0 deletions
36
README.md
36
README.md
|
@ -1,3 +1,39 @@
|
||||||
# Validate YAML
|
# Validate YAML
|
||||||
|
|
||||||
> Github action to validate yaml files against a JSON schema
|
> Github action to validate yaml files against a JSON schema
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Validate your YAML files against a JSON structure by providing a schema path and a list of files.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Validate YAML
|
||||||
|
uses: brittonhayes/validate-yaml
|
||||||
|
with:
|
||||||
|
schemaPath: 'schema.json'
|
||||||
|
files: |
|
||||||
|
example/foo.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
### Example JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"test": {
|
||||||
|
"structure": {
|
||||||
|
"myValue": "string",
|
||||||
|
"myValue2": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Example Valid YAML for this schema
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
test:
|
||||||
|
structure:
|
||||||
|
myValue: '1'
|
||||||
|
myValue2: '2'
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in a new issue