Skip to content

Commit

Permalink
feat: add validation
Browse files Browse the repository at this point in the history
  • Loading branch information
logonoff committed Nov 1, 2024
1 parent 3bc1fdc commit f718388
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/validate-workshops.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
on: [push, pull_request]

jobs:
validate-workshops:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate metadata files against schema
uses: thiagodnf/[email protected]
with:
yamlFiles: '[0-9][0-9][0-9][0-9]/metadata.yml'
jsonSchemaFile: 'schema.json'
59 changes: 59 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"title": "Workshops",
"description": "An object containing a year's worth of workshops.",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/utmgdsc/workshops/blob/main/schema.json",
"patternProperties": {
"^.*$": {
"description": "The category name, e.g., \"Web Development\", \"Machine Learning\", etc.",
"type": "array",
"items": {
"description": "The metadata of a workshop.",
"type": "object",
"properties": {
"name": {
"description": "The name of the workshop.",
"type": "string"
},
"host": {
"description": "An array of the names of the hosts of the workshop.",
"items": {
"type": "string"
},
"type": "array"
},
"description": {
"description": "The description of the workshop, e.g., it could be from an Instagram caption or announcement.",
"type": "string"
},
"date": {
"description": "The date of the workshop in MM-DD format, since the year is already specified in the file path.",
"type": "string",
"pattern": "^([0][1-9]|[[1][0-2])-([0-2][0-9]|3[0-1])$"
},
"code": {
"description": "The URL to the starter code code of the workshop.",
"type": "string",
"format": "uri"
},
"slides": {
"description": "The filename of the slides of the workshop. The slides must be in the same directory as the metadata.yml file.",
"type": "string"
},
"recording": {
"description": "The URL to the recording of the workshop.",
"type": "string",
"format": "uri"
}
},
"required": [
"name",
"host",
"description",
"date"
]
},
"additionalProperties": false
}
}
}

0 comments on commit f718388

Please sign in to comment.