Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions .github/workflows/validate-data.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
name: Validate Dataset
# .github/workflows/validate-data.yml
name: Validate dataset

on:
push:
paths:
- "data/**/*.json"
- ".github/schema/**/*.json"
- ".github/workflows/validate-data.yml"
pull_request:
paths:
- 'data/terms.json'
- "data/**/*.json"
- ".github/schema/**/*.json"
- ".github/workflows/validate-data.yml"

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
- name: Checkout
uses: actions/checkout@v4

- name: Install ajv-cli
run: npm install -g ajv-cli
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"

# Use npx to pull AJV + formats
- name: Validate terms.json against schema
run: ajv validate -s .github/schema/terms.schema.json -d data/terms.json --errors=text
run: |
npx -y -p ajv-cli@5 -p ajv@8 -p ajv-formats@3 \
ajv validate \
-s .github/schema/terms.schema.json \
-d data/terms.json \
-c ajv-formats \
--spec=draft7 \
--errors=text