Skip to content

Commit

Permalink
👷 Add CI to check YML files (huggingface#909)
Browse files Browse the repository at this point in the history
  • Loading branch information
coyotte508 authored Mar 6, 2023
1 parent e219e84 commit 4609f0b
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/validate-yaml.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions schemas/_blog.schema.yml
Original file line number Diff line number Diff line change
@@ -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())
8 changes: 8 additions & 0 deletions schemas/_events.schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
list(include('event'))
---
event:
name: str()
link: str()
date: str()
date_formatted: str(required=False)
description: str()
5 changes: 5 additions & 0 deletions schemas/_tags.schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
list(include('tag'))
---
tag:
value: str()
label: str()

0 comments on commit 4609f0b

Please sign in to comment.