Skip to content

Commit 0beb076

Browse files
Remove old review bot comments (#2243)
2 parents 9f13a3f + 76dfdd8 commit 0beb076

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

.github/workflows/ClaudeReview.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,28 @@ jobs:
4545
role-to-assume: ${{ secrets.AWS_BEDROCK_ROLE_ARN }}
4646
aws-region: ${{ secrets.AWS_REGION }}
4747

48+
- name: Minimize older bot comments
49+
env:
50+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
run: |
52+
COMMENTS=$(gh pr view ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --json comments \
53+
--jq '.comments[] | select(.author.login == "github-actions[bot]") | .id')
54+
55+
if [ -z "$COMMENTS" ]; then
56+
echo "No bot comments to minimize"
57+
exit 0
58+
fi
59+
60+
for NODE_ID in $COMMENTS; do
61+
echo "Minimizing comment: $NODE_ID"
62+
gh api graphql -f query='
63+
mutation($id: ID!) {
64+
minimizeComment(input: {subjectId: $id, classifier: OUTDATED}) {
65+
minimizedComment { isMinimized }
66+
}
67+
}' -f id="$NODE_ID" || echo "Failed to minimize $NODE_ID, continuing..."
68+
done
69+
4870
- name: Run Claude Code Review
4971
uses: anthropics/claude-code-action@f4fb5c6cdccc1ee7af63692f5d08d56efaa64cc8 # v1.0.121
5072
with:
@@ -62,7 +84,7 @@ jobs:
6284
6385
Follow the skill guidelines precisely. Focus only on changed files in the diff; ignore dist/, lockfiles, and generated files.
6486
claude_args: >-
65-
--model ${{ env.CLAUDE_MODEL }} --max-turns 15 --allowedTools "Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh pr comment:*),Bash(gh api:*),Bash(gh run:*),Bash(git log:*),Bash(git diff:*),Bash(ls:*),Bash(find:*),mcp__github_inline_comment__create_inline_comment,Read,Grep,Glob"
87+
--model ${{ env.CLAUDE_MODEL }} --max-turns 30 --allowedTools "Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh pr comment:*),Bash(gh api:*),Bash(gh run:*),Bash(git log:*),Bash(git diff:*),Bash(ls:*),Bash(find:*),mcp__github_inline_comment__create_inline_comment,Read,Grep,Glob"
6688
6789
interactive:
6890
name: Claude Interactive

0 commit comments

Comments
 (0)