|
20 | 20 | with: |
21 | 21 | ref: ${{ github.event.pull_request.head.sha }} |
22 | 22 | fetch-depth: 1 |
23 | | - |
| 23 | + |
| 24 | + - name: Remove prior Claude review comment (so review runs again) |
| 25 | + env: |
| 26 | + GH_TOKEN: ${{ github.token }} |
| 27 | + run: | |
| 28 | + pr=${{ github.event.pull_request.number }} |
| 29 | + repo=${{ github.repository }} |
| 30 | + |
| 31 | + # Find first issue comment whose body starts with "## Claude Code Review" |
| 32 | + comment_id=$(gh api repos/$repo/issues/$pr/comments \ |
| 33 | + --jq '.[] | select(.body | startswith("## Claude Code Review")) | .id' | head -n 1) |
| 34 | + |
| 35 | + if [ -n "$comment_id" ]; then |
| 36 | + echo "Deleting prior Claude review comment id=$comment_id" |
| 37 | + gh api -X DELETE repos/$repo/issues/comments/$comment_id |
| 38 | + else |
| 39 | + echo "No prior Claude review comment found." |
| 40 | + fi |
| 41 | + |
24 | 42 | - name: Run Claude Code Review |
25 | 43 | id: claude-review |
26 | 44 | uses: anthropics/claude-code-action@v1 |
|
59 | 77 | If you cannot access the diff/files, say exactly what is blocked. |
60 | 78 | If posting a PR comment is blocked, write the full review to the GitHub Actions job summary instead. |
61 | 79 |
|
| 80 | + IMPORTANT: |
| 81 | + - Do NOT stop just because a previous "Claude Code Review" comment exists. |
| 82 | + - If a prior Claude review exists, post a NEW comment titled "Claude Code Review (updated)" that includes: |
| 83 | + - current head SHA: ${{ github.event.pull_request.head.sha }} |
| 84 | + - files changed count + up to 15 file paths |
| 85 | + - 3–6 bullet summary of changes |
| 86 | + - findings or at least 3 improvement opportunities with file paths |
| 87 | + Post as ONE top-level PR comment. |
| 88 | +
|
62 | 89 | additional_permissions: | |
63 | 90 | actions: read |
0 commit comments