Skip to content

Commit 5d24945

Browse files
authored
Add feedback reminder for CodeRabbit (#4932)
Signed-off-by: Tomoyuki Morita <moritato@amazon.com>
1 parent 342a78b commit 5d24945

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CodeRabbit Feedback Reminder
2+
on:
3+
pull_request_review_comment:
4+
types: [created]
5+
permissions:
6+
pull-requests: write
7+
jobs:
8+
add-reaction-encouragement:
9+
runs-on: ubuntu-latest
10+
if: github.event.comment.user.login == 'coderabbitai[bot]'
11+
steps:
12+
- uses: actions/github-script@v8
13+
with:
14+
github-token: ${{ secrets.GITHUB_TOKEN }}
15+
script: |
16+
const comment = context.payload.comment;
17+
const originalBody = comment.body;
18+
const feedbackMessage = "\n\n<sub>👋 Leave emoji reaction (👍/👎) to track effectiveness of CodeRabbit.</sub>";
19+
20+
// Only add the message if it's not already there
21+
if (!originalBody.includes(feedbackMessage)) {
22+
await github.rest.pulls.updateReviewComment({
23+
owner: context.repo.owner,
24+
repo: context.repo.repo,
25+
comment_id: comment.id,
26+
body: originalBody + feedbackMessage
27+
});
28+
}

0 commit comments

Comments
 (0)