name: Editorial Lint

on:
  push:
    paths:
      - 'config/themes/catalog/**'
      - 'code/scripts/lint_theme_editorial.py'
      - 'code/type_definitions_theme_catalog.py'
      - '.github/workflows/editorial_lint.yml'
  pull_request:
    paths:
      - 'config/themes/catalog/**'
      - 'code/scripts/lint_theme_editorial.py'
      - 'code/type_definitions_theme_catalog.py'

jobs:
  lint-editorial:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'
      - name: Install deps
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt || true
          pip install pydantic PyYAML
      - name: Run editorial lint (minimum examples enforced)
        run: |
          python code/scripts/lint_theme_editorial.py --strict --enforce-min-examples
        env:
          EDITORIAL_MIN_EXAMPLES_ENFORCE: '1'
