Skip to content

Commit 8231c60

Browse files
committed
fix(ci): consolidate Claude review into single sticky comment
- Remove instruction to use gh pr comment for summaries - Add STEP 4 with explicit single-comment policy - Include instructions to update existing comments - Add cleanup step to delete duplicate comments
1 parent c15a781 commit 8231c60

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

.github/workflows/claude.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ jobs:
8585
- Only create NEW inline comments for HIGH-PRIORITY issues found in changed files.
8686
- Limit to 5-7 NEW comments maximum per review.
8787
- Use CLAUDE.md for project-specific guidance.
88-
- Use `gh pr comment` for summary-level feedback.
8988
- Use `mcp__github_inline_comment__create_inline_comment` sparingly for critical code issues only.
9089
9190
## STEP 3: Coverage analysis
@@ -122,6 +121,33 @@ jobs:
122121
- New implementations/files: Must have ≥75% test coverage
123122
- Modified code: Changed lines should be exercised by existing or new tests
124123
- No coverage regressions: Overall coverage should not decrease
124+
125+
## STEP 4: Post ONE consolidated summary comment
126+
127+
CRITICAL: You must post exactly ONE summary comment containing ALL results (pre-commit, review, coverage).
128+
DO NOT post multiple separate comments. Use this format:
129+
130+
```
131+
## PR Review Summary
132+
133+
### Pre-commit Checks
134+
[status and any fixes made]
135+
136+
### Code Review
137+
[critical issues found, if any]
138+
139+
### Test Coverage
140+
[coverage table and analysis]
141+
142+
---
143+
*Last updated: <timestamp>*
144+
```
145+
146+
To ensure only ONE comment exists:
147+
1. Find existing claude[bot] comment: `gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments --jq '.[] | select(.user.login == "claude[bot]") | .id' | head -1`
148+
2. If found, UPDATE it: `gh api --method PATCH repos/${{ github.repository }}/issues/comments/<ID> -f body="<content>"`
149+
3. If not found, CREATE: `gh pr comment ${{ github.event.pull_request.number }} --body "<content>"`
150+
4. Delete any OTHER claude[bot] comments to clean up duplicates: `gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments --jq '.[] | select(.user.login == "claude[bot]") | .id' | tail -n +2 | xargs -I {} gh api --method DELETE repos/${{ github.repository }}/issues/comments/{}`
125151
claude_args: '--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh issue view:*),Bash(gh issue list:*),Bash(gh api:*),Bash(uv run prek *),Bash(uv run coverage *),Bash(uv run pytest *),Bash(git status*),Bash(git add *),Bash(git commit *),Bash(git push*),Bash(git diff *),Bash(git checkout *),Read,Glob,Grep"'
126152
additional_permissions: |
127153
actions: read

0 commit comments

Comments
 (0)