diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..ce2cc0c --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,27 @@ +name: Validate hall of fame JSON +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + json-yaml-validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: json-yaml-validate + id: json-yaml-validate + uses: GrantBirki/json-yaml-validate@v5 + with: + schema_mappings: | + - type: json + schema: ./schemas/halloffame-schema.json + files: + - ./halloffame.json + json_schema_version: draft-07 \ No newline at end of file diff --git a/halloffame.json b/halloffame.json index efdfaa0..ae26a2b 100644 --- a/halloffame.json +++ b/halloffame.json @@ -48,7 +48,7 @@ "first": "Anarchy Stars", "second": "3 elves 1 santa", "third": "PayBack", - "beta": "Runie Runners", + "beta": "Runie Runners" }, { "name": "November 2025", @@ -821,4 +821,4 @@ "third": "#BlameFanzy" } ] -} +} \ No newline at end of file diff --git a/js/halloffameloader.js b/js/halloffameloader.js index 565ba17..4802251 100644 --- a/js/halloffameloader.js +++ b/js/halloffameloader.js @@ -1,6 +1,6 @@ var numLoaded = 0; -fetch("https://lowink.iplabs.ink/halloffame.json") +fetch(`https://${window.location.host}/halloffame.json`) .then(response => { return response.json() }) diff --git a/schemas/halloffame-schema.json b/schemas/halloffame-schema.json new file mode 100644 index 0000000..ac95d39 --- /dev/null +++ b/schemas/halloffame-schema.json @@ -0,0 +1,55 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Hall of Frame", + "type": "object", + "properties": { + "hallOfFame": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "teams": { + "type": "string" + }, + "first": { + "type": "string" + }, + "second": { + "type": "string" + }, + "third": { + "type": "string" + }, + "beta": { + "type": "string" + }, + "gamma": { + "type": "string" + }, + "id": { + "type": "string" + }, + "delta": { + "type": "string" + }, + "epsilon": { + "type": "string" + } + }, + "required": [ + "name", + "teams", + "first", + "second", + "third" + ] + } + } + }, + "required": [ + "hallOfFame" + ] +} \ No newline at end of file