diff --git a/.github/workflows/validate-yaml.yml b/.github/workflows/validate-yaml.yml new file mode 100644 index 0000000000..4615a40fff --- /dev/null +++ b/.github/workflows/validate-yaml.yml @@ -0,0 +1,27 @@ +name: YAML schema validator +on: + push: + paths: + - "_*.yml" + - "schemas/_*.schema.yml" + +jobs: + yaml-schema-validation: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: "Validate _events.yml" + uses: nrkno/yaml-schema-validator-github-action@v4 + with: + schema: schemas/_events.schema.yml + target: _events.yml + - name: "Validate _blog.yml" + uses: nrkno/yaml-schema-validator-github-action@v4 + with: + schema: schemas/_blog.schema.yml + target: _blog.yml + - name: "Validate _tags.yml" + uses: nrkno/yaml-schema-validator-github-action@v4 + with: + schema: schemas/_tags.schema.yml + target: _tags.yml \ No newline at end of file diff --git a/schemas/_blog.schema.yml b/schemas/_blog.schema.yml new file mode 100644 index 0000000000..ae7f79ab1f --- /dev/null +++ b/schemas/_blog.schema.yml @@ -0,0 +1,12 @@ +list(include('blog')) +--- +# It's possible to use regex to validate dates like June 8, 2020 or a whole lot of other things, if needed +blog: + local: str(required=False) + external: str(required=False) + title: str() + thumbnail: str(required=False) + author: str() + guest: bool(required=False) + date: str() + tags: list(str()) diff --git a/schemas/_events.schema.yml b/schemas/_events.schema.yml new file mode 100644 index 0000000000..02ab6d64ec --- /dev/null +++ b/schemas/_events.schema.yml @@ -0,0 +1,8 @@ +list(include('event')) +--- +event: + name: str() + link: str() + date: str() + date_formatted: str(required=False) + description: str() \ No newline at end of file diff --git a/schemas/_tags.schema.yml b/schemas/_tags.schema.yml new file mode 100644 index 0000000000..1b185edb27 --- /dev/null +++ b/schemas/_tags.schema.yml @@ -0,0 +1,5 @@ +list(include('tag')) +--- +tag: + value: str() + label: str() \ No newline at end of file