-
Notifications
You must be signed in to change notification settings - Fork 3
43 lines (37 loc) · 1.2 KB
/
validate-yaml.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# For documentation on the github environment, see
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
#
# For documentation on the syntax of this file, see
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
---
name: Validate-YAML
on:
push:
branches: [main, next-minor, next-patch]
pull_request:
branches: [main, next-minor, next-patch]
permissions:
contents: read
jobs:
validate-yaml:
runs-on: ubuntu-latest
steps:
- name: Checkout GEDCOM.io
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Validate YAML
run: yamllint .
- name: Validate YAML against schema
working-directory: ${{github.workspace}}/registry_tools
run: |
find .. -type f -name "*.yaml" -not -path "../registry_tools/*" -exec dirname {} \; | sort -u | while read -r dir; do
yaml_files=("$dir"/*.yaml)
if [ "${#yaml_files[@]}" -gt 0 ]; then
echo Checking directory $dir
python3 validator.py "${yaml_files[@]}"
if [ $? -ne 0 ]; then
exit 1
fi
fi
done