Skip to content

Commit d6092e8

Browse files
authored
Merge pull request #2 from AnswerCite/CI-20250913-01
Update validate-data.yml
2 parents ce55ae9 + c6d66e8 commit d6092e8

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed
Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,37 @@
1-
name: Validate Dataset
1+
# .github/workflows/validate-data.yml
2+
name: Validate dataset
23

34
on:
5+
push:
6+
paths:
7+
- "data/**/*.json"
8+
- ".github/schema/**/*.json"
9+
- ".github/workflows/validate-data.yml"
410
pull_request:
511
paths:
6-
- 'data/terms.json'
12+
- "data/**/*.json"
13+
- ".github/schema/**/*.json"
14+
- ".github/workflows/validate-data.yml"
715

816
jobs:
917
validate:
1018
runs-on: ubuntu-latest
1119
steps:
12-
- name: Checkout repo
20+
- name: Checkout
1321
uses: actions/checkout@v4
1422

15-
- name: Install ajv-cli
16-
run: npm install -g ajv-cli
23+
- name: Setup Node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: "20"
1727

28+
# Use npx to pull AJV + formats
1829
- name: Validate terms.json against schema
19-
run: ajv validate -s .github/schema/terms.schema.json -d data/terms.json --errors=text
30+
run: |
31+
npx -y -p ajv-cli@5 -p ajv@8 -p ajv-formats@3 \
32+
ajv validate \
33+
-s .github/schema/terms.schema.json \
34+
-d data/terms.json \
35+
-c ajv-formats \
36+
--spec=draft7 \
37+
--errors=text

0 commit comments

Comments
 (0)