From e1c8237399f600eed73136f8ecafd7178a719e0d Mon Sep 17 00:00:00 2001 From: Ed B Date: Sun, 24 Mar 2024 12:14:57 +0200 Subject: [PATCH] workflow(json-validate): WORK IN PROGRESS, github actions, validate JSON --- .github/workflows/ci.yml | 11 +++++++++++ schema.json | 25 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 schema.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5032b38..e293bbd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/schema.json b/schema.json new file mode 100644 index 0000000..23ad0f0 --- /dev/null +++ b/schema.json @@ -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"] + } +} \ No newline at end of file