generated from Informatievlaanderen/OSLOthema-template
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (55 loc) · 2.08 KB
/
configuration_validator.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Validate JSONs
on: [push]
jobs:
copy-configuration-files:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
# Different Node versions possible. Each node version will trigger the action
node-version:
- 18.x
steps:
- name: Checkout source branch
uses: actions/checkout@v4
with:
# Hardcoded reference to the thema repo, since this repo contains the boilerplate for all repos
repository: Informatievlaanderen/OSLOthema-template
ref: config
# The source folder contains the configuration files, as defined in the thema-template-repository
path: source
- name: Checkout target branch
uses: actions/checkout@v4
with:
# Dynamic reference to the active repository so that it works immediately when creating a new thema repo
repository: ${{ github.repository }}
ref: standaardenregister
# Target is the folder containing the content of thema-repository
path: target
# Extra step to debug the file structure
- name: List file structure of source dir
shell: bash
run: |
ls source
- name: List file structure of target dir
shell: bash
run: |
ls target
- name: Validate JSON
id: validate
# https://github.com/marketplace/actions/json-yaml-validate
uses: GrantBirki/json-yaml-validate@v2.5.0
with:
json_schema: source/schemas/configuration.json
json_extension: json
base_dir: target
comment: true
use_gitignore: false
- name: Log validation result to summary
run: |
echo "# Summary" >> $GITHUB_STEP_SUMMARY
if [ ${{ steps.validate.outputs.success }} == "true" ]; then
echo "All configuration file(s) in the repository are valid!" >> $GITHUB_STEP_SUMMARY
else
echo "There are some errors in the configuration file(s). Please check the logs to see which files" >> $GITHUB_STEP_SUMMARY
fi