Skip to content
Closed
Show file tree
Hide file tree
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
58 changes: 58 additions & 0 deletions .github/workflows/schedule-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Gate schedule DATA edits before they reach the deploy branch (#54).
#
# This is the validation CI the existing jekyll.yml (build + deploy on push to gh-pages)
# does NOT provide: a Jekyll build stays green even when a schedule is wrong, because
# Liquid renders an undefined macro (e.g. `{{ mlect }}`) as the empty string. This workflow
# runs tools/validate_schedule.py (Tier 0 schema + Tier 1 referential) so a bad edit fails a
# check with a clear, annotated error instead of silently shipping a broken page.
#
# Make this a REQUIRED status check in branch protection on gh-pages to actually gate merges.
name: Validate schedule data

on:
pull_request:
paths:
- '_data/schedule/**'
- 'ICI3D.github.io' # submodule pointer = the shared people data
- 'schemas/**'
- 'tools/validate_schedule.py'
- '.github/workflows/schedule-validate.yml'
push:
branches: ['gh-pages']
paths:
- '_data/schedule/**'
- 'ICI3D.github.io'
- 'schemas/**'
- 'tools/validate_schedule.py'
workflow_dispatch:

permissions:
contents: read

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout (with the ICI3D.github.io submodule for _data/team)
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install validator dependencies
run: python -m pip install --quiet pyyaml jsonschema

- name: Validate every cohort schedule
run: |
shopt -s nullglob
files=(_data/schedule/*/*.yml)
if [ ${#files[@]} -eq 0 ]; then
echo "No cohort schedule files under _data/schedule/<clinic>/ — nothing to validate."
exit 0
fi
echo "Validating: ${files[*]}"
python3 tools/validate_schedule.py "${files[@]}" --github
Loading