Skip to content

Add automated validation for JSON schemas #2

Add automated validation for JSON schemas

Add automated validation for JSON schemas #2

name: Validate Schemas
on:
pull_request:
paths:
- '**/theme.json'
- '**/style/*.json'
- '**/assets/fonts/*.json'
jobs:
validate-schemas:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: './package-lock.json'
- name: Install dependencies
run: npm ci
- name: Validate changed schemas
run: |
modified_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- '**/theme.json' '**/styles/*.json' '**/assets/fonts/*.json')
echo "Modified files: $modified_files"
node theme-utils.mjs validate-schema "$modified_files"