diff --git a/.github/workflows/validate-events-data.yml b/.github/workflows/validate-events-data.yml new file mode 100644 index 00000000000..0815295df56 --- /dev/null +++ b/.github/workflows/validate-events-data.yml @@ -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!" diff --git a/data/schemas/events.json b/data/schemas/events.json new file mode 100644 index 00000000000..7c5811989da --- /dev/null +++ b/data/schemas/events.json @@ -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" + ] + } +}