|
| 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