-
Notifications
You must be signed in to change notification settings - Fork 3
132 lines (112 loc) · 4.02 KB
/
rebuild-indexes.yml
File metadata and controls
132 lines (112 loc) · 4.02 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Rebuild Documentation Indexes
on:
schedule:
# Run every Sunday at 2:00 AM UTC
- cron: "0 2 * * 0"
workflow_dispatch:
# Allow manual triggering
inputs:
plugins:
description: "Plugins to rebuild (comma-separated, or 'all')"
required: false
default: "all"
jobs:
rebuild:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --all-extras
- name: Rebuild WPILib stable index
run: |
echo "Rebuilding WPILib stable index..."
uv run python scripts/build_index.py wpilib --version stable -v
continue-on-error: true
- name: Rebuild WPILib 2025 index
run: |
echo "Rebuilding WPILib 2025 index..."
uv run python scripts/build_index.py wpilib --version 2025 -v
continue-on-error: true
- name: Rebuild REV index
run: |
echo "Rebuilding REV index..."
uv run python scripts/build_index.py rev -v
continue-on-error: true
- name: Rebuild CTRE index
run: |
echo "Rebuilding CTRE index..."
uv run python scripts/build_index.py ctre -v
continue-on-error: true
- name: Rebuild PhotonVision index
run: |
echo "Rebuilding PhotonVision index..."
uv run python scripts/build_index.py photonvision -v
continue-on-error: true
- name: Rebuild Redux index
run: |
echo "Rebuilding Redux index..."
uv run python scripts/build_index.py redux -v
continue-on-error: true
- name: Check for changes
id: check_changes
run: |
if git diff --quiet src/wpilib_mcp/plugins/*/data/*.json; then
echo "changes=false" >> $GITHUB_OUTPUT
echo "No changes to index files"
else
echo "changes=true" >> $GITHUB_OUTPUT
echo "Index files have been updated"
git diff --stat src/wpilib_mcp/plugins/*/data/*.json
fi
- name: Create Pull Request
if: steps.check_changes.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: rebuild documentation indexes"
title: "chore: Weekly documentation index rebuild"
body: |
## Automated Index Rebuild
This PR was automatically generated by the weekly index rebuild workflow.
### What changed
- Rebuilt documentation indexes from upstream sources
- Updated search content for all enabled plugins
### Vendors updated
- WPILib (stable + 2025)
- REV Robotics
- CTRE Phoenix
- PhotonVision
- Redux
### Review checklist
- [ ] Index sizes look reasonable
- [ ] No unexpected file deletions
- [ ] Tests pass
---
*Generated on: ${{ github.event.repository.updated_at || 'manual trigger' }}*
branch: chore/rebuild-indexes
delete-branch: true
labels: |
automated
documentation
- name: Summary
run: |
echo "## Index Rebuild Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Plugin | Pages |" >> $GITHUB_STEP_SUMMARY
echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY
for f in src/wpilib_mcp/plugins/*/data/*.json; do
plugin=$(echo $f | cut -d'/' -f4)
count=$(python3 -c "import json; print(len(json.load(open('$f')).get('pages', [])))" 2>/dev/null || echo "error")
echo "| $plugin | $count |" >> $GITHUB_STEP_SUMMARY
done