Skip to content

Commit b22b3f1

Browse files
authored
Merge pull request #11 from IPLSplatoon/add-pr-checks
feat: add pr check for json and fix file
2 parents 61108ab + 264c8ff commit b22b3f1

4 files changed

Lines changed: 85 additions & 3 deletions

File tree

.github/workflows/pr.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Validate hall of fame JSON
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
json-yaml-validate:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
18+
- name: json-yaml-validate
19+
id: json-yaml-validate
20+
uses: GrantBirki/json-yaml-validate@v5
21+
with:
22+
schema_mappings: |
23+
- type: json
24+
schema: ./schemas/halloffame-schema.json
25+
files:
26+
- ./halloffame.json
27+
json_schema_version: draft-07

halloffame.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"first": "Anarchy Stars",
4949
"second": "3 elves 1 santa",
5050
"third": "PayBack",
51-
"beta": "Runie Runners",
51+
"beta": "Runie Runners"
5252
},
5353
{
5454
"name": "November 2025",
@@ -821,4 +821,4 @@
821821
"third": "#BlameFanzy"
822822
}
823823
]
824-
}
824+
}

js/halloffameloader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var numLoaded = 0;
22

3-
fetch("https://lowink.iplabs.ink/halloffame.json")
3+
fetch(`https://${window.location.host}/halloffame.json`)
44
.then(response => {
55
return response.json()
66
})

schemas/halloffame-schema.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Hall of Frame",
4+
"type": "object",
5+
"properties": {
6+
"hallOfFame": {
7+
"type": "array",
8+
"items": {
9+
"type": "object",
10+
"properties": {
11+
"name": {
12+
"type": "string"
13+
},
14+
"teams": {
15+
"type": "string"
16+
},
17+
"first": {
18+
"type": "string"
19+
},
20+
"second": {
21+
"type": "string"
22+
},
23+
"third": {
24+
"type": "string"
25+
},
26+
"beta": {
27+
"type": "string"
28+
},
29+
"gamma": {
30+
"type": "string"
31+
},
32+
"id": {
33+
"type": "string"
34+
},
35+
"delta": {
36+
"type": "string"
37+
},
38+
"epsilon": {
39+
"type": "string"
40+
}
41+
},
42+
"required": [
43+
"name",
44+
"teams",
45+
"first",
46+
"second",
47+
"third"
48+
]
49+
}
50+
}
51+
},
52+
"required": [
53+
"hallOfFame"
54+
]
55+
}

0 commit comments

Comments
 (0)