feat: Add blog post on the importance of context in AI-powered DevOps #271
Workflow file for this run
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 Review | |
| on: | |
| pull_request: | |
| types: [opened, reopened, ready_for_review] | |
| # Optional: Only run on specific file changes | |
| # paths: | |
| # - "src/**/*.ts" | |
| # - "src/**/*.tsx" | |
| # - "src/**/*.js" | |
| # - "src/**/*.jsx" | |
| jobs: | |
| claude-review: | |
| # Skip automated PRs from pulumi-bot | |
| if: github.event.pull_request.user.login != 'pulumi-bot' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: read | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Run Claude Code Review | |
| id: claude-review | |
| uses: anthropics/claude-code-action@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | |
| # The canonical review criteria are defined in .claude/commands/docs-review.md. | |
| # This prompt directs Claude to read that file as the source of truth. | |
| prompt: | | |
| You are reviewing pull request #${{ github.event.pull_request.number }}. | |
| **CI Efficiency Guidelines (IMPORTANT - minimize token usage):** | |
| 1. Start by running `gh pr view ${{ github.event.pull_request.number }} --json title,body,files,additions,deletions` to get PR metadata | |
| 2. Get the full diff with `gh pr diff ${{ github.event.pull_request.number }}` | |
| 3. Work primarily from the diff output - this is much more efficient than reading full files | |
| 4. Only use the Read tool on specific files when the diff doesn't provide enough context | |
| 5. Do NOT attempt to run `make serve`, `make lint`, or `make build` - these commands are not available in CI and will fail | |
| 6. Focus your review on the changed lines shown in the diff, not entire files | |
| 7. Use Grep sparingly - only when absolutely necessary to understand context | |
| **Review Criteria:** | |
| Read `.claude/commands/docs-review.md` for the complete, canonical review criteria. Use those criteria to guide your review. | |
| **Posting Your Review:** | |
| After completing your review, post it to the PR by running: | |
| ``` | |
| gh pr comment ${{ github.event.pull_request.number }} --body "YOUR_REVIEW_CONTENT_HERE" | |
| ``` | |
| Your review should include: | |
| - Issues found with specific line numbers | |
| - Constructive suggestions using ````suggestion` blocks | |
| - An instruction to mention you ('@claude') if the author wants additional reviews or fixes | |
| # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md | |
| # or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options | |
| # Allow essential file reading tools (Read, Glob, Grep) and gh commands for PR interaction | |
| claude_args: '--allowed-tools "Read,Glob,Grep,Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh pr comment:*),Bash(gh issue view:*)"' | |