Skip to content
Merged
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
14 changes: 12 additions & 2 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Loading