-
Notifications
You must be signed in to change notification settings - Fork 3
37 lines (32 loc) · 1007 Bytes
/
checkjson.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
name: 'Validate schema and casing'
on:
workflow_dispatch:
push:
paths:
- 'metrics.json'
pull_request:
jobs:
test:
name: 'Validate metrics.json schema'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Ensure that all directories are lowercase'
id: lowercase
shell: pwsh
run: |
$directories = Get-ChildItem -Recurse -Path ./templates -Directory
foreach ($dir in $directories) {
if ($dir.Name -cne $dir.Name.ToLower()) {
Write-Error "Directory $dir must be lowercase!"
}
}
- name: 'Validate JSON Schema for metrics.json'
id: validation
shell: pwsh
run: |
$files = Get-ChildItem -Recurse | Where-Object { $_.Name -eq 'metrics.json' }
$files |% {
Write-Host "Found $($_.Fullname). Validate JSON Schema."
./.github/scripts/validateMetrics.ps1 -metricsFile $($_.FullName)
}