Skip to content

Commit affb6a2

Browse files
committed
ci: Collapse preivous claude[bot] PR review comments
1 parent 4a27ae8 commit affb6a2

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/claude-code-review.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,31 @@ jobs:
2121
with:
2222
fetch-depth: 1
2323

24+
25+
- name: Dismiss old Claude bot comments
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: |
29+
# Get PR comments from claude[bot] and hide them as outdated
30+
REPO="${{ github.repository }}"
31+
PR_NUMBER="${{ github.event.pull_request.number }}"
32+
33+
# Get review comments (PR review comments)
34+
gh api "repos/$REPO/pulls/$PR_NUMBER/comments" --jq '.[] | select(.user.login == "claude[bot]") | .node_id' | while read -r comment_node_id; do
35+
if [ -n "$comment_node_id" ]; then
36+
echo "Hiding review comment: $comment_node_id"
37+
gh api graphql -f query='
38+
mutation($id: ID!) {
39+
minimizeComment(input: {subjectId: $id, classifier: OUTDATED}) {
40+
minimizedComment {
41+
isMinimized
42+
}
43+
}
44+
}' -f id="$comment_node_id"
45+
fi
46+
done
47+
48+
2449
- name: Run Claude Code Review
2550
id: claude-review
2651
env:

0 commit comments

Comments
 (0)