mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:10:45 +00:00
ci: validate docs mdx before publish
This commit is contained in:
2
.github/codex/prompts/docs-agent.md
vendored
2
.github/codex/prompts/docs-agent.md
vendored
@@ -28,4 +28,6 @@ Required workflow:
|
||||
4. Run `pnpm check:docs` if dependencies are available.
|
||||
5. Leave the worktree clean if no docs need changes.
|
||||
|
||||
If `pnpm docs:check-mdx` or `pnpm check:docs` reports MDX parse errors, fix only the syntax needed for the listed existing docs files. Preserve prose meaning, frontmatter, code fences, and links; do not broadly rewrite translated or source content while repairing parser failures.
|
||||
|
||||
When uncertain, prefer no edit and explain the uncertainty in the final message.
|
||||
|
||||
25
.github/codex/prompts/docs-mdx-repair.md
vendored
Normal file
25
.github/codex/prompts/docs-mdx-repair.md
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
# OpenClaw Docs MDX Repair Agent
|
||||
|
||||
You are repairing generated OpenClaw documentation after a fast MDX validation failure.
|
||||
|
||||
Goal: fix only the MDX syntax errors reported by the checker.
|
||||
|
||||
Hard limits:
|
||||
|
||||
- Edit only existing Markdown/MDX files under the locale path named by `LOCALE`.
|
||||
- Do not edit source English docs unless `LOCALE=en`.
|
||||
- Do not edit code, workflows, package metadata, generated sync metadata, translation memory, or assets.
|
||||
- Do not add, delete, or rename files.
|
||||
- Preserve the meaning of translated prose.
|
||||
- Preserve frontmatter, `x-i18n.source_hash`, links, code fences, JSX component names, and existing page structure.
|
||||
- Avoid broad formatting or retranslation.
|
||||
|
||||
Required workflow:
|
||||
|
||||
1. Read `.openclaw-sync/mdx/${LOCALE}.json` when it exists.
|
||||
2. Inspect only the listed files and nearby lines.
|
||||
3. Fix the minimal syntax issue, such as broken JSX attribute quoting, mismatched component closing tags, raw `<` text, raw HTML comments, or accidental top-level `import`/`export` text.
|
||||
4. Run `node source/scripts/check-docs-mdx.mjs "docs/${LOCALE}" --json-out ".openclaw-sync/mdx/${LOCALE}.json"`.
|
||||
5. Leave no changes outside `docs/${LOCALE}`.
|
||||
|
||||
When uncertain, prefer the smallest escaping fix: backticks for literal words, `<` for literal `<`, double quotes around JSX attribute values, and balanced component tags.
|
||||
6
.github/workflows/docs-sync-publish.yml
vendored
6
.github/workflows/docs-sync-publish.yml
vendored
@@ -43,6 +43,12 @@ jobs:
|
||||
--source-repo "$GITHUB_REPOSITORY" \
|
||||
--source-sha "$GITHUB_SHA"
|
||||
|
||||
- name: Install docs MDX checker dependency
|
||||
run: npm install --no-save --package-lock=false @mdx-js/mdx@3.1.1
|
||||
|
||||
- name: Check publish docs MDX
|
||||
run: node "$GITHUB_WORKSPACE/publish/.openclaw-sync/check-docs-mdx.mjs" "$GITHUB_WORKSPACE/publish/docs"
|
||||
|
||||
- name: Commit publish repo sync
|
||||
working-directory: publish
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user