[NO JIRA] Moving claude code bot reaction and comments collection job from claude-code-action repo#30
[NO JIRA] Moving claude code bot reaction and comments collection job from claude-code-action repo#30moulougeta wants to merge 2 commits intomasterfrom
Conversation
|
Comment
You can also request review from a specific team by commenting 💡 If you see something that doesn't look right, check the configuration guide. |
There was a problem hiding this comment.
Pull request overview
Changes: Maintenance (1)
This PR migrates a GitHub Actions workflow from the claude-code-action repository to this repository. The workflow collects and summarizes feedback (reactions and replies) on Claude bot comments across repositories in the transferwise organization.
Changes:
- Added a scheduled workflow that runs nightly to gather Claude bot feedback statistics
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Find Claude bot comments (checking for common bot usernames) | ||
| const claudeComments = allComments.filter(comment => { | ||
| const username = comment.user?.login?.toLowerCase() || ''; | ||
| return username.includes('claude') || | ||
| (username === 'github-actions[bot]' && comment.body?.includes('Claude')) || | ||
| username.includes('claude-bot') || | ||
| username.includes('claudebot'); | ||
| }); | ||
|
|
There was a problem hiding this comment.
The Claude bot detection logic is duplicated in two places (lines 158-163 and lines 242-243). Consider extracting this into a helper function to ensure consistency and easier maintenance.
| // Find Claude bot comments (checking for common bot usernames) | |
| const claudeComments = allComments.filter(comment => { | |
| const username = comment.user?.login?.toLowerCase() || ''; | |
| return username.includes('claude') || | |
| (username === 'github-actions[bot]' && comment.body?.includes('Claude')) || | |
| username.includes('claude-bot') || | |
| username.includes('claudebot'); | |
| }); | |
| // Helper to determine if a comment is from the Claude bot (or related bots) | |
| function isClaudeBotComment(comment) { | |
| const username = comment.user?.login?.toLowerCase() || ''; | |
| return username.includes('claude') || | |
| (username === 'github-actions[bot]' && comment.body?.includes('Claude')) || | |
| username.includes('claude-bot') || | |
| username.includes('claudebot'); | |
| } | |
| // Find Claude bot comments (checking for common bot usernames) | |
| const claudeComments = allComments.filter(isClaudeBotComment); |
| // Check if comment is after Claude's and within our time window | ||
| return commentTime > claudeTime && | ||
| commentTime >= cutoffTime && | ||
| comment.user?.login?.toLowerCase() !== 'claude' && | ||
| !comment.user?.login?.toLowerCase().includes('claude'); |
There was a problem hiding this comment.
This bot detection logic is inconsistent with the more comprehensive check on lines 158-163. It misses checking for 'github-actions[bot]', 'claude-bot', and 'claudebot' variations. Use the same detection logic as above to avoid missing valid Claude bot comments.
| // Check if comment is after Claude's and within our time window | |
| return commentTime > claudeTime && | |
| commentTime >= cutoffTime && | |
| comment.user?.login?.toLowerCase() !== 'claude' && | |
| !comment.user?.login?.toLowerCase().includes('claude'); | |
| const login = comment.user?.login?.toLowerCase() || ''; | |
| // Check if comment is after Claude's and within our time window and not from a bot user | |
| return commentTime > claudeTime && | |
| commentTime >= cutoffTime && | |
| login !== 'claude' && | |
| login !== 'claude-bot' && | |
| login !== 'claudebot' && | |
| login !== 'github-actions[bot]' && | |
| !login.endsWith('[bot]'); |
|
|
||
| // Truncate comment to reasonable length for table display | ||
| const truncatedComment = reply.body?.substring(0, 100).replace(/\n/g, ' ') || ''; | ||
| const commentDisplay = truncatedComment.length === 100 ? truncatedComment + '...' : truncatedComment; |
There was a problem hiding this comment.
The logic checks if truncatedComment.length === 100 but should check if the original reply.body?.substring(0, 100) operation actually truncated content by comparing against reply.body?.length. A comment with exactly 100 characters won't get the ellipsis, while one with 101+ characters will, but this check doesn't accurately reflect whether truncation occurred.
| const commentDisplay = truncatedComment.length === 100 ? truncatedComment + '...' : truncatedComment; | |
| const commentDisplay = reply.body && reply.body.length > 100 ? truncatedComment + '...' : truncatedComment; |
Context
[NO JIRA] Moving claude code bot reaction and comments collection job from claude-code-action repo
Checklist