mirror of
https://github.com/restincode/restincode.git
synced 2026-09-11 17:19:30 +02:00
Add schema/person.schema.json and scripts/validate_people.py, run via a pre-commit hook and a GitHub Actions job on pull requests. Checks: - people/*.json match the schema (keys, types, item shapes) - every peoplelist.json entry has a file and every file is listed once - filenames are lowercase alphanumeric (two legacy names grandfathered) - local image paths exist under images/ - link fields are http(s) with no surrounding whitespace - text-only fields contain no HTML; maintext stays raw HTML by design Warns (non-fatal) on gallery items with no title, which the page uses as alt text. Adds a pip dependabot entry for scripts/requirements.txt.
32 lines
880 B
YAML
32 lines
880 B
YAML
# Validates memorial data (people/*.json, peoplelist.json) against
|
|
# schema/person.schema.json and the site's cross-file conventions.
|
|
name: Validate memorial data
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "people/**"
|
|
- "peoplelist.json"
|
|
- "images/**"
|
|
- "schema/**"
|
|
- "scripts/**"
|
|
- ".github/workflows/validate-people.yml"
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
with:
|
|
python-version: "3.12"
|
|
cache: pip
|
|
cache-dependency-path: scripts/requirements.txt
|
|
- run: pip install -r scripts/requirements.txt
|
|
- run: python scripts/validate_people.py
|