Files
market/.github/workflows/i18n-validate.yml
Yige a205ef20f0 feat: 迁移统一目录元数据契约 (#102)
## 中文

- 为 System Agent、34 个 Builtin Skill、28 个 Pointer/Collection 条目增加 catalog
sidecar
- 覆盖 147 个 collection child,并固定可证明的来源;无法证明的内容保持 listing-only/unknown
- 增加 strict Schema、validator、collection check 与 CI 完整性门禁

## English

- Add catalog metadata sidecars for the System Agent, 34 built-in
Skills, and 28 pointer/collection entries
- Cover 147 collection children while keeping unverifiable facts
listing-only or unknown
- Add strict schemas, validators, deterministic collection checks, and
CI completeness gates

## 验证 / Verification

- Catalog validator 17/17
- Collection generator 4/4
- 63 sidecars, 147 children, zero errors
2026-08-31 04:10:49 -04:00

90 lines
3.0 KiB
YAML

name: i18n Validate
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
validate:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect relevant changes
id: changes
env:
EVENT_NAME: ${{ github.event_name }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
PUSH_BEFORE: ${{ github.event.before }}
PUSH_AFTER: ${{ github.event.after }}
run: |
set -e
case "$EVENT_NAME" in
pull_request)
git fetch --no-tags --depth=1 origin "$BASE_SHA" 2>/dev/null || true
range="${BASE_SHA}...${HEAD_SHA}"
;;
push)
if [ -n "$PUSH_BEFORE" ] && [ "$PUSH_BEFORE" != "0000000000000000000000000000000000000000" ]; then
range="${PUSH_BEFORE}...${PUSH_AFTER}"
else
# initial push or unknown before — assume relevant
echo "relevant=true" >> "$GITHUB_OUTPUT"
exit 0
fi
;;
*)
echo "relevant=true" >> "$GITHUB_OUTPUT"
exit 0
;;
esac
changed=$(git diff --name-only "$range" || true)
if echo "$changed" | grep -qE '^(skills/|agents/|schemas/|manifest\.json$|categories\.json$|scripts/i18n/|scripts/catalog/|scripts/gen-collection-children\.py$)'; then
echo "relevant=true" >> "$GITHUB_OUTPUT"
else
echo "relevant=false" >> "$GITHUB_OUTPUT"
fi
- name: Install uv
if: steps.changes.outputs.relevant == 'true'
uses: astral-sh/setup-uv@v3
- name: Run validator unit tests
if: steps.changes.outputs.relevant == 'true'
run: uv run --quiet scripts/i18n/test_validate_i18n.py
- name: Run catalog validator unit tests
if: steps.changes.outputs.relevant == 'true'
run: |
uv run --quiet scripts/catalog/test_validate_catalog_metadata.py
uv run --quiet scripts/catalog/test_collection_generator.py
- name: Validate catalog metadata
if: steps.changes.outputs.relevant == 'true'
run: uv run --quiet scripts/catalog/validate_catalog_metadata.py --require-complete
- name: Validate i18n
if: steps.changes.outputs.relevant == 'true'
run: uv run --quiet scripts/i18n/validate-i18n.py
- name: Check for stale translations
if: steps.changes.outputs.relevant == 'true'
run: uv run --quiet scripts/i18n/translate.py --check
- name: Check generated collection children
if: steps.changes.outputs.relevant == 'true'
run: uv run --quiet scripts/gen-collection-children.py --check
- name: Skip notice
if: steps.changes.outputs.relevant != 'true'
run: echo "No i18n-relevant changes; validation skipped."