-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (35 loc) · 1.12 KB
/
validate-filter-schema.yaml
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
name: Validate JSON Files
on:
push:
paths:
- '**/*.json'
- '.github/workflows/validate-filter-schema.yaml'
pull_request:
paths:
- '**/*.json'
- '.github/workflows/validate-filter-schema.yaml'
jobs:
validate_filter_schema:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install check-jsonschema
run: pip install check-jsonschema
- name: Download Current Filter Schema
run: |
curl -o schema.json https://raw.githubusercontent.com/Kaqemeex/loot-filters-ui/refs/heads/main/schema.json
- name: print schema
run: cat schema.json
- name: Validate JSON files
run: |
find . -type f -name "*.json" -not -path "./schema.json" -print0 | while IFS= read -r -d '' file; do
echo "Validating $file..."
if ! check-jsonschema -v --schemafile schema.json "$file"; then
echo "❌ Validation failed for $file"
exit 1
fi
done