mirror of
https://github.com/placeAtlas/atlas.git
synced 2024-10-15 05:49:12 +02:00
Merge pull request #377 from ProstoSanja/master
Validate JSON schema before merging
This commit is contained in:
commit
35d31c9e6f
2 changed files with 26 additions and 0 deletions
12
.github/workflows/github-actions.yml
vendored
Normal file
12
.github/workflows/github-actions.yml
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
name: Validate JSON
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
Validate-JSON:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Validate JSON
|
||||||
|
run: |
|
||||||
|
chmod +x ${{ github.workspace }}/tools/validate_json.py
|
||||||
|
python3 ${{ github.workspace }}/tools/validate_json.py ${{ github.workspace }}/web/atlas.json
|
14
tools/validate_json.py
Normal file
14
tools/validate_json.py
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import json
|
||||||
|
|
||||||
|
path = "./../web/atlas.json"
|
||||||
|
|
||||||
|
# path override as 1st param: validate_json.py path_to_file.json
|
||||||
|
if (len(sys.argv) > 1):
|
||||||
|
path = sys.argv[1]
|
||||||
|
|
||||||
|
json.load(open(path))
|
||||||
|
|
||||||
|
print("JSON is valid")
|
Loading…
Reference in a new issue