workflow(json-validate): WORK IN PROGRESS, github actions, validate JSON

This commit is contained in:
Ed B 2024-03-24 12:14:57 +02:00
commit e1c8237399
2 changed files with 36 additions and 0 deletions

View file

@ -6,12 +6,14 @@ on:
- Cargo.toml
- resources/assets/*.ttf
- src/**
- resources/assets/*.json
pull_request:
paths:
- Cargo.lock
- Cargo.toml
- resources/assets/*.ttf
- src/**
- resources/assets/*.json
jobs:
lint:
@ -55,3 +57,12 @@ jobs:
with:
components: clippy,rustfmt
- run: cargo ${{ matrix.lint }}${{ matrix.args }}
verify-json-validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Validate JSON
uses: docker://orrosenblatt/validate-json-action:latest
env:
INPUT_SCHEMA: /schema.json
INPUT_JSONS: /resources/assets/uad_lists.json

25
schema.json Normal file
View file

@ -0,0 +1,25 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"packageName": {
"type": "object",
"properties": {
"list": {"type": "string"},
"description": {"type": "string"},
"dependencies": {
"type": "array",
"items": {"type": "string"}
},
"neededBy": {
"type": "array",
"items": {"type": "string"}
},
"labels": {
"type": "array",
"items": {"type": "string"}
},
"removal": {"type": "string"}
},
"required": ["list", "description", "dependencies", "neededBy", "labels", "removal"]
}
}