From 9bce114c976c9201e4041ae1c9e43144bc5e2ed8 Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Sat, 13 Aug 2022 20:07:33 -0500 Subject: [PATCH 1/2] chore: Fix incorrect references in metadata schema --- metadata.schema.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/metadata.schema.json b/metadata.schema.json index 2f94ffbbc..ecc767d91 100644 --- a/metadata.schema.json +++ b/metadata.schema.json @@ -1,5 +1,5 @@ { - "$schema": "https://json-schema.org/draft/2020-12/schema", + "$schema": "https://json-schema.org/draft-07/schema", "$id": "https://raw.githubusercontent.com/TRaSH-/Guides/master/metadata.schema.json", "type": "object", "additionalProperties": false, @@ -9,8 +9,8 @@ "type": "object", "additionalProperties": false, "properties": { - "radarr": "#/$defs/radarr", - "sonarr": "#/$defs/sonarr" + "radarr": { "$ref": "#/$defs/radarr" }, + "sonarr": { "$ref": "#/$defs/sonarr" } } } }, @@ -27,14 +27,14 @@ "type": "object", "additionalProperties": false, "properties": { - "custom_formats": "#/$defs/custom_formats" + "custom_formats": { "$ref": "#/$defs/custom_formats" } } }, "sonarr": { "type": "object", "additionalProperties": false, "properties": { - "release_profiles": "#/$defs/release_profiles" + "release_profiles": { "$ref": "#/$defs/release_profiles" } } } } From e1d93b248ed6ff41c3356f8bd12aca4678961f8c Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Sat, 13 Aug 2022 09:25:25 -0500 Subject: [PATCH 2/2] ci: Validation workflow for metadata.json The goal of this pipeline is to assist in catching issues with changes made to `metadata.json`. This will be especially useful to have during pull requests, where changes can be validated before they are merged, which will avoid breaking any tooling that depends on the `metadata.json` file. --- .github/workflows/metadata-validation.yml | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/metadata-validation.yml diff --git a/.github/workflows/metadata-validation.yml b/.github/workflows/metadata-validation.yml new file mode 100644 index 000000000..88546450d --- /dev/null +++ b/.github/workflows/metadata-validation.yml @@ -0,0 +1,25 @@ +name: Validate Metadata JSON + +on: + push: + paths: + - metadata.json + - metadata.schema.json + - .github/workflows/metadata-validation.yml + pull_request: + paths: + - metadata.json + - metadata.schema.json + - .github/workflows/metadata-validation.yml + +jobs: + validate: + runs-on: ubuntu-latest + name: Validate metadata.json + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.x" + - run: pip install jsonschema + - run: jsonschema -i metadata.json metadata.schema.json