diff --git a/.github/workflows/docs-ci.yml b/.github/workflows/docs-ci.yml index d3f4447..e662e8d 100644 --- a/.github/workflows/docs-ci.yml +++ b/.github/workflows/docs-ci.yml @@ -12,6 +12,14 @@ on: description: Fail when AGENTS.md is missing type: boolean default: true + syntax-roots: + description: Space-separated paths whose JSON/YAML files must parse (catalogs pass their docs paths, not implementation code) + type: string + default: "." + link-globs: + description: Space-separated, single-quoted globs of Markdown files whose relative links are checked + type: string + default: "'./**/*.md'" permissions: contents: read @@ -27,6 +35,7 @@ jobs: - name: Check repository structure env: REQUIRE_AGENTS_MD: ${{ inputs.require-agents-md }} + SYNTAX_ROOTS: ${{ inputs.syntax-roots }} run: | python3 - <<'PY' import json, os, re, sys @@ -62,7 +71,8 @@ jobs: errors.append(f"{path}: missing '## Status' section") # Every JSON and YAML file must parse. - for root, dirs, files in os.walk("."): + roots = [r for r in os.environ.get("SYNTAX_ROOTS", ".").split() if os.path.exists(r)] + for root, dirs, files in (w for r in roots for w in os.walk(r)): dirs[:] = [d for d in dirs if d not in (".git", "node_modules")] for f in files: path = os.path.join(root, f) @@ -87,5 +97,5 @@ jobs: - uses: actions/checkout@v4 - uses: lycheeverse/lychee-action@v2 with: - args: --offline --no-progress './**/*.md' + args: --offline --no-progress ${{ inputs.link-globs }} fail: true