Claude Code doc review exp #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "+ Claude Code / Documentation Review" | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| documentation-review: | |
| name: Review doc changes | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # TODO: why do we need fetch depth 0? | |
| - name: Get changed files # TODO: test locally | |
| id: changed-files | |
| run: | | |
| echo "Getting diff from base branch..." | |
| git diff --name-only origin/${{ github.base_ref }}...HEAD > changed_files.txt | |
| cat changed_files.txt | |
| echo "files<<EOF" >> $GITHUB_OUTPUT | |
| cat changed_files.txt >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Show file changes # TODO: test locally | |
| run: | | |
| echo "=== Changed Files ===" | |
| cat changed_files.txt | |
| echo "" | |
| echo "=== File Diffs ===" | |
| git diff origin/${{ github.base_ref }}...HEAD | |
| - name: Run Claude Code to read changes | |
| uses: anthropics/claude-code-action@v1 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | |
| prompt: | | |
| You are reviewing a PR. | |
| First, run 'git diff origin/${{ github.base_ref }}...HEAD' to see what changed. | |
| Then read the changed files and log: | |
| 1) List of all changed files | |
| 2) Brief description of what changed in each file | |
| This is just a verification - don't provide detailed review yet. | |
| claude_args: >- | |
| --max-turns 5 | |
| --model claude-sonnet-4-5-20250929 |