Skip to content

Commit 38525d8

Browse files
snomiaoclaude
andauthored
feat: add weekly documentation accuracy check workflow (#6298)
## Summary Adds a new automated workflow that runs weekly to check and update documentation accuracy. ## Changes - Created `.github/workflows/weekly-docs-check.yaml` - Workflow runs every Monday at 9 AM UTC or via manual dispatch - Uses Claude to fact-check all documentation against the current codebase - Automatically creates/updates a draft PR with documentation corrections ## Workflow Features 1. **Schedule**: Runs weekly (Mondays at 9 AM UTC) or on-demand via workflow_dispatch 2. **Documentation Review**: Claude analyzes: - All markdown files in `docs/` - Project guidelines in `CLAUDE.md` - README files throughout the repository - Claude command documentation in `.claude/commands/` 3. **Automated PR Creation**: Uses `peter-evans/create-pull-request` action to: - Create or update the `docs/weekly-update` branch - Generate a draft PR with all documentation updates - Apply `documentation` and `automated` labels ## Benefits - Keeps documentation synchronized with code changes - Identifies outdated API references and deprecated functions - Catches missing documentation for new features - Ensures code examples remain valid and tested ## Test Plan - [x] YAML syntax validated - [ ] Workflow can be manually triggered to verify functionality - [ ] PR creation works as expected 🤖 Generated with [Claude Code](https://claude.com/claude-code) ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6298-feat-add-weekly-documentation-accuracy-check-workflow-2986d73d365081d48ce0f4cf181c377f) by [Unito](https://www.unito.io) --------- Co-authored-by: Claude <[email protected]>
1 parent c374975 commit 38525d8

File tree

1 file changed

+145
-0
lines changed

1 file changed

+145
-0
lines changed
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
name: "Weekly Documentation Check"
2+
description: "Automated weekly documentation accuracy check and update via Claude"
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
id-token: write
8+
9+
on:
10+
schedule:
11+
# Run every Monday at 9 AM UTC
12+
- cron: '0 9 * * 1'
13+
workflow_dispatch:
14+
15+
concurrency:
16+
group: ${{ github.workflow }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
docs-check:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 45
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v5
26+
with:
27+
fetch-depth: 0
28+
ref: main
29+
30+
- name: Install pnpm
31+
uses: pnpm/action-setup@v4
32+
with:
33+
version: 10
34+
35+
- name: Setup Node.js
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: '20'
39+
cache: 'pnpm'
40+
41+
- name: Install dependencies for analysis tools
42+
run: |
43+
# Check if packages are already available locally
44+
if ! pnpm list typescript @vue/compiler-sfc >/dev/null 2>&1; then
45+
echo "Installing TypeScript and Vue compiler globally..."
46+
pnpm install -g typescript @vue/compiler-sfc
47+
else
48+
echo "TypeScript and Vue compiler already available locally"
49+
fi
50+
51+
- name: Run Claude Documentation Review
52+
uses: anthropics/[email protected]
53+
with:
54+
prompt: |
55+
Is all documentation still 100% accurate?
56+
57+
INSTRUCTIONS:
58+
1. Fact-check all documentation against the current codebase
59+
2. Look for:
60+
- Outdated API references
61+
- Deprecated functions or components still documented
62+
- Missing documentation for new features
63+
- Incorrect code examples
64+
- Broken internal references
65+
- Configuration examples that no longer work
66+
- Documentation that contradicts actual implementation
67+
3. Update any inaccurate or outdated documentation
68+
4. Add documentation for significant undocumented features
69+
5. Ensure all code examples are valid and tested against current code
70+
71+
Focus on these key areas:
72+
- docs/**/*.md (all documentation files)
73+
- CLAUDE.md (project guidelines)
74+
- README.md files throughout the repository
75+
- .claude/commands/*.md (Claude command documentation)
76+
77+
Make changes directly to the documentation files as needed.
78+
DO NOT modify any source code files unless absolutely necessary for documentation accuracy.
79+
80+
After making all changes, create a comprehensive PR message summary:
81+
1. Write a detailed PR body to /tmp/pr-body-${{ github.run_id }}.md in markdown format
82+
2. Include:
83+
- ## Summary section with bullet points of what was changed
84+
- ## Changes Made section with details organized by category
85+
- ## Review Notes section with any important context
86+
3. Be specific about which files were updated and why
87+
4. If no changes were needed, write a brief message stating documentation is up to date
88+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
89+
claude_args: "--max-turns 256 --allowedTools 'Bash(git status),Bash(git diff),Bash(git log),Bash(pnpm:*),Bash(npm:*),Bash(node:*),Bash(tsc:*),Bash(echo:*),Read,Write,Edit,Glob,Grep'"
90+
continue-on-error: false
91+
env:
92+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+
94+
- name: Check for changes
95+
id: check_changes
96+
run: |
97+
if git diff --quiet && git diff --cached --quiet; then
98+
echo "has_changes=false" >> $GITHUB_OUTPUT
99+
echo "No documentation changes needed"
100+
else
101+
echo "has_changes=true" >> $GITHUB_OUTPUT
102+
echo "Documentation changes detected"
103+
fi
104+
105+
- name: Create default PR body if not generated
106+
if: steps.check_changes.outputs.has_changes == 'true'
107+
run: |
108+
if [ ! -f /tmp/pr-body-${{ github.run_id }}.md ]; then
109+
cat > /tmp/pr-body-${{ github.run_id }}.md <<'EOF'
110+
## Automated Documentation Review
111+
112+
This PR contains documentation updates identified by the weekly automated review.
113+
114+
### Review Process
115+
- Automated fact-checking against current codebase
116+
- Verification of code examples and API references
117+
- Detection of outdated or missing documentation
118+
119+
### What was checked
120+
- All markdown documentation in `docs/`
121+
- Project guidelines in `CLAUDE.md`
122+
- README files throughout the repository
123+
- Claude command documentation in `.claude/commands/`
124+
125+
**Note**: This is an automated PR. Please review all changes carefully before merging.
126+
127+
🤖 Generated by weekly documentation check workflow
128+
EOF
129+
fi
130+
131+
- name: Create or Update Pull Request
132+
if: steps.check_changes.outputs.has_changes == 'true'
133+
uses: peter-evans/create-pull-request@v7
134+
with:
135+
token: ${{ secrets.GITHUB_TOKEN }}
136+
commit-message: 'docs: weekly documentation accuracy update'
137+
branch: docs/weekly-update
138+
delete-branch: true
139+
title: 'docs: Weekly Documentation Update'
140+
body-path: /tmp/pr-body-${{ github.run_id }}.md
141+
labels: |
142+
documentation
143+
automated
144+
draft: true
145+
assignees: ${{ github.repository_owner }}

0 commit comments

Comments
 (0)