-
Notifications
You must be signed in to change notification settings - Fork 1.1k
72 lines (64 loc) · 2.37 KB
/
docs-generate.yml
File metadata and controls
72 lines (64 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Docs — Reference Drift Check
# Fails a PR if the committed /website/docs/reference/ output disagrees
# with what tools/generate_docs_reference.py would produce from the live
# Python tool/resource registry. Contributors should regenerate locally:
#
# cd Server && uv run python ../tools/generate_docs_reference.py
#
# or install the pre-commit hook to make this automatic:
#
# tools/install-hooks.sh
on:
pull_request:
branches: [beta, main]
paths:
- Server/src/services/tools/**
- Server/src/services/resources/**
- Server/src/services/registry/**
- website/docs/reference/**
- tools/generate_docs_reference.py
- .github/workflows/docs-generate.yml
push:
branches: [beta]
paths:
- Server/src/services/tools/**
- Server/src/services/resources/**
- Server/src/services/registry/**
- website/docs/reference/**
- tools/generate_docs_reference.py
- .github/workflows/docs-generate.yml
workflow_dispatch: {}
jobs:
check:
name: Check docs reference is fresh
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: latest
- name: Set up Python
run: uv python install 3.10
- name: Sync Server deps
working-directory: Server
run: uv sync
- name: Drift check
working-directory: Server
run: uv run python ../tools/generate_docs_reference.py --check
- name: Tool-count sanity
run: |
set -euo pipefail
# Match the decorator at start-of-line (skips imports and docstring mentions).
decorator_count=$(grep -rhE "^@mcp_for_unity_tool\(" Server/src/services/tools/ | wc -l | tr -d ' ')
# md_count excludes group landing pages (index.md) and the catalog root.
md_count=$(find website/docs/reference/tools -name '*.md' -not -name 'index.md' | wc -l | tr -d ' ')
echo "decorator_count=$decorator_count, md_count=$md_count"
if [[ "$decorator_count" != "$md_count" ]]; then
echo "Mismatch: $decorator_count @mcp_for_unity_tool decorators vs $md_count reference pages." >&2
echo "Run: cd Server && uv run python ../tools/generate_docs_reference.py" >&2
exit 1
fi