Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/claude-pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,23 @@ jobs:

const output = claudeComment?.body ?? '';
console.log('Claude comment preview:', output.slice(0, 300));

// Previous Claude comments cleanup
const allClaudeComments = [...comments.data].filter(c => c.user?.login === 'claude[bot]');
for (const c of allClaudeComments) {
if (claudeComment && c.id !== claudeComment.id && c.body?.includes('REVIEW_RESULT:')) {
try {
await github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: c.id
});
console.log(`Removed previous Claude review comment ${c.id}`);
} catch (e) {
console.log(`Failed to remove comment ${c.id}: ${e.message}`);
}
}
}

const failed = output.includes('REVIEW_RESULT: FAIL');
const errored = '${{ steps.claude.outcome }}' === 'failure';
Expand Down Expand Up @@ -302,6 +319,23 @@ jobs:
const output = claudeComment?.body ?? '';
console.log('Claude comment preview:', output.slice(0, 200));

// Previous Claude comments cleanup
const allClaudeComments = [...comments.data].filter(c => c.user?.login === 'claude[bot]');
for (const c of allClaudeComments) {
if (claudeComment && c.id !== claudeComment.id && c.body?.includes('REVIEW_RESULT:')) {
try {
await github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: c.id
});
console.log(`Removed previous Claude review comment ${c.id}`);
} catch (e) {
console.log(`Failed to remove comment ${c.id}: ${e.message}`);
}
}
}

const failed = output.includes('REVIEW_RESULT: FAIL');
const errored = '${{ steps.claude.outcome }}' === 'failure';
const hasReviewResult = output.includes('REVIEW_RESULT:');
Expand Down
Loading