Skip to content

Commit 41bef8b

Browse files
authored
Fix merge conflict on PR (#1)
1 parent d2f8280 commit 41bef8b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1617
-1609
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
name: Generate the documentation from the JSON Schemas
2-
31
on:
42
push:
53
branches:
64
- main
7-
- docs
85
jobs:
96
generate_doc:
7+
name: Generate the documentation from the JSON Schemas
108
runs-on: ${{ matrix.os }}
119
strategy:
1210
fail-fast: false
@@ -16,6 +14,10 @@ jobs:
1614
contents: write
1715
steps:
1816
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v3
18+
with:
19+
repository: ${{ github.repository }}.wiki
20+
path: .wiki
1921
- uses: actions/setup-python@v4
2022
with:
2123
python-version: "3.11"
@@ -28,27 +30,24 @@ jobs:
2830
- name: Install json-schema-for-humans
2931
run: pip install json-schema-for-humans
3032

31-
- name: Create documentation directory
32-
run: mkdir -p _docs
33-
3433
- name: Generate the documentation
3534
run: |
36-
generate-schema-doc --config template_name=md_nested ./.schema/controller.json ./_docs/controller.md
37-
generate-schema-doc --config template_name=md_nested ./.schema/manufacturer.json ./_docs/manufacturer.md
38-
generate-schema-doc --config template_name=md_nested ./.schema/category.json ./_docs/category.md
35+
generate-schema-doc --config template_name=md_nested ./.schema/controller.json "./.wiki/Controller Definition.md"
36+
generate-schema-doc --config template_name=md_nested ./.schema/manufacturer.json "./.wiki/Manufacturer Definition.md"
37+
generate-schema-doc --config template_name=md_nested ./.schema/category.json "./.wiki/Category Definition.md"
38+
39+
- name: Generate Conntroller List
40+
run: |
41+
python3 .utilities/generate_controller_tables.py
3942
4043
- run: git pull
4144
- name: Commit files
4245
run: |
46+
cd .wiki
4347
git config --local user.email "action@github.com"
4448
git config --local user.name "GitHub Action"
4549
git add *
4650
if ! git diff-index --quiet HEAD; then
4751
git commit -m "Update documentation" -a
4852
fi
49-
50-
- name: push changes
51-
uses: ad-m/github-push-action@master
52-
with:
53-
github_token: ${{ secrets.GITHUB_TOKEN }}
54-
branch: ${{ steps.extract_branch.outputs.branch }}
53+
git push

.github/workflows/validate-json.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,12 @@ on:
22
pull_request:
33
branches:
44
- main
5-
name: Validate JSON
5+
66
jobs:
77
validate:
8+
name: Validate JSON Files against schemas
89
runs-on: ubuntu-latest
9-
permissions:
10-
pull-requests: write
1110
steps:
12-
- name: Delete previous comment
13-
uses: izhangzhihao/delete-comment@master
14-
with:
15-
github_token: ${{ secrets.GITHUB_TOKEN }}
16-
delete_user_name: github-actions[bot]
17-
issue_number: ${{ github.event.number }}
1811
- uses: actions/checkout@v3
1912
- name: Validate Category JSON
2013
uses: dsanders11/json-schema-validate-action@v1.1.0
@@ -31,9 +24,16 @@ jobs:
3124
with:
3225
schema: ".schema/controller.json"
3326
files: "*/*/*/config.json"
34-
- name: Comment PR
35-
if: failure()
36-
uses: thollander/actions-comment-pull-request@v2.5.0
37-
with:
38-
message: |
39-
Validation of the JSON files has failed, please check the [Github Action log](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) to see why
27+
- name: Send status
28+
if: ${{ success() }}
29+
run: |
30+
curl --request POST \
31+
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} \
32+
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
33+
--header 'content-type: application/json' \
34+
--data '{
35+
"context": "Validate JSON Files against schemas",
36+
"state": "success",
37+
"description": "JSON Files are valid",
38+
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
39+
}'

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
.schema/template.json
1+
.schema/template.json
2+
.schema/.json_schema.json
3+
.wiki

.schema/category.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$id": "ControllerDatabase_category",
23
"$schema": "http://json-schema.org/draft-06/schema#",
34
"$ref": "#/definitions/CategoryDefinition",
45
"definitions": {

.schema/controller.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$id": "ControllerDatabase_controller",
23
"$schema": "http://json-schema.org/draft-06/schema#",
34
"$ref": "#/definitions/ControllerDefinition",
45
"definitions": {
@@ -541,10 +542,14 @@
541542
"additionalProperties": false,
542543
"properties": {
543544
"name": {
544-
"type": "string"
545+
"type": "string",
546+
"title": "Name"
545547
},
546548
"image": {
547-
"type": "string"
549+
"type": "string",
550+
"pattern": "(.*)\\.(p|P)(n|N)(g|G)",
551+
"title": "Image",
552+
"description": "Name of a PNG image showing the mentionned variant\nThe image must be placed in the same folder as this config file\nNote: At least one of the variants must use the default `image.png` file"
548553
}
549554
},
550555
"required": [

.schema/manufacturer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$id": "ControllerDatabase_manufacturer",
23
"$schema": "http://json-schema.org/draft-06/schema#",
34
"$ref": "#/definitions/ManufacturerDefinition",
45
"definitions": {

.utilities/consoles_list.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"dc": "Sega Dreamcast",
3+
"n64": "Nintendo 64",
4+
"nes": "Nintendo Entertainment System / Famicom",
5+
"ngc": "Nintendo GameCube",
6+
"nsw": "Nintendo Switch",
7+
"ps1": "Sony PlayStation 1",
8+
"ps2": "Sony PlayStation 2",
9+
"ps3": "Sony PlayStation 3",
10+
"ps4": "Sony PlayStation 4",
11+
"ps5": "Sony PlayStation 5",
12+
"saturn": "Sega Saturn",
13+
"smd": "Sega Mega Drive / Sega Genesis",
14+
"snes": "Super Nintendo Entertainment System / Super Famicom",
15+
"wii": "Nintendo Wii",
16+
"wiiu": "Nintendo Wii U",
17+
"xb1": "Xbox One",
18+
"xb360": "Xbox 360",
19+
"xbox": "Xbox",
20+
"xbs": "Xbox Series X|S"
21+
}

0 commit comments

Comments
 (0)