From 67bf85e5f8bca7d383dd891f2c3ff01ce9321e13 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sun, 4 Oct 2020 21:02:33 +0200 Subject: [PATCH] [CI skip] Added Wiki schema validation --- .github/configs/wiki-schema.json | 9 +++++++ .../yaml-linter.yml} | 0 .github/workflows/json-validator.yml | 24 +++++++++++++++++++ .github/workflows/yaml-linter.yml | 2 +- 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .github/configs/wiki-schema.json rename .github/{yaml-linter-config.yml => configs/yaml-linter.yml} (100%) create mode 100644 .github/workflows/json-validator.yml diff --git a/.github/configs/wiki-schema.json b/.github/configs/wiki-schema.json new file mode 100644 index 000000000..e59cef7b6 --- /dev/null +++ b/.github/configs/wiki-schema.json @@ -0,0 +1,9 @@ +{ + "type" : "object", + "additionalProperties" : false, + "patternProperties" : { + "^[A-Z0-9_]+$" : { + "type" : "string" + } + } +} diff --git a/.github/yaml-linter-config.yml b/.github/configs/yaml-linter.yml similarity index 100% rename from .github/yaml-linter-config.yml rename to .github/configs/yaml-linter.yml diff --git a/.github/workflows/json-validator.yml b/.github/workflows/json-validator.yml new file mode 100644 index 000000000..2babf25fa --- /dev/null +++ b/.github/workflows/json-validator.yml @@ -0,0 +1,24 @@ +name: Validate JSON + +on: + push: + paths: + - 'src/main/resources/wiki.json' + pull_request: + paths: + - 'src/main/resources/wiki.json' + +jobs: + validate: + + name: Validate JSON + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Validate JSON + uses: docker://orrosenblatt/validate-json-action:latest@sha256:02370758b8b199e0477da11ecfdd498c75c561685056b5c31b925a4ab95df7f4 + env: + INPUT_SCHEMA: '.github/configs/wiki-schema.json' + INPUT_JSONS: 'src/main/resources/wiki.json' \ No newline at end of file diff --git a/.github/workflows/yaml-linter.yml b/.github/workflows/yaml-linter.yml index c38813bea..00f94e27c 100644 --- a/.github/workflows/yaml-linter.yml +++ b/.github/workflows/yaml-linter.yml @@ -20,4 +20,4 @@ jobs: - name: YAML Linter uses: ibiqlik/action-yamllint@v1.0.0 with: - config_file: '.github/yaml-linter-config.yml' + config_file: '.github/configs/yaml-linter.yml'