-
Notifications
You must be signed in to change notification settings - Fork 31
44 lines (36 loc) · 1.23 KB
/
validate-sources.yml
File metadata and controls
44 lines (36 loc) · 1.23 KB
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
name: Validate Data Sources
on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
paths:
- "firstdata/sources/**/*.json"
- "firstdata/schemas/datasource-schema.json"
jobs:
protect-schema:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Block schema modifications
run: |
if git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -q "firstdata/schemas/datasource-schema.json"; then
echo "❌ PRs must not modify firstdata/schemas/datasource-schema.json"
echo "Schema changes require direct commit to main by a maintainer."
exit 1
fi
validate:
needs: protect-schema
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: uv sync
- name: Validate all source JSON files
run: |
find firstdata/sources -name "*.json" | xargs uv run check-jsonschema \
--schemafile firstdata/schemas/datasource-schema.json
- name: Check for duplicate IDs
run: uv run python scripts/check_ids.py