Skip to content

Commit

Permalink
ktl-382 chore: validate community data
Browse files Browse the repository at this point in the history
  • Loading branch information
nikpachoo committed Apr 27, 2022
1 parent b0acafe commit 1522600
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/validate-events-data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Validate Community Events Data

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
validate_user_groups_data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: chrisdickinson/setup-yq@latest
with:
yq-version: 'v4.9.5'
- run: |
jsonschema -i <(yq eval --tojson -j data/events.yml) data/schemas/events.json
echo "community events data is valid!"
58 changes: 58 additions & 0 deletions data/schemas/events.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"lang": {
"type": "string"
},
"startDate": {
"type": "string"
},
"endDate": {
"type": "string"
},
"location": {
"type": "string"
},
"speaker": {
"type": "string"
},
"title": {
"type": "string"
},
"subject": {
"type": "string"
},
"url": {
"type": "string"
},
"online": {
"type": "boolean"
},
"content": {
"type": "object",
"properties": {
"slides": {
"type": "string"
},
"video": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false,
"required": [
"lang",
"startDate",
"endDate",
"speaker",
"title",
"subject",
"url"
]
}
}

0 comments on commit 1522600

Please sign in to comment.