Skip to content

Commit bd0cc0e

Browse files
committed
Refactor extractMentionAndRequest function to handle generic review requests; set userRequest to null for common review keywords.
1 parent 578225f commit bd0cc0e

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

handlers/webhooks.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,30 @@ function extractMentionAndRequest(commentBody) {
264264
}
265265

266266
const mentionMatch = commentBody.match(/@dalestudy\s*(.*)/i);
267-
const userRequest = mentionMatch && mentionMatch[1].trim() ? mentionMatch[1].trim() : null;
267+
let userRequest = mentionMatch && mentionMatch[1].trim() ? mentionMatch[1].trim() : null;
268+
269+
// 일반적인 리뷰 요청 키워드만 있는 경우 userRequest를 null로 처리
270+
// (전체 리뷰 모드로 동작하도록)
271+
if (userRequest) {
272+
const normalizedRequest = userRequest.toLowerCase().trim();
273+
const genericReviewKeywords = [
274+
'review',
275+
'review this',
276+
'please review',
277+
'review please',
278+
'리뷰',
279+
'리뷰해줘',
280+
'리뷰 해줘',
281+
'리뷰해주세요',
282+
'리뷰 해주세요',
283+
'코드리뷰',
284+
'코드 리뷰'
285+
];
286+
287+
if (genericReviewKeywords.includes(normalizedRequest)) {
288+
userRequest = null;
289+
}
290+
}
268291

269292
return { isMentioned: true, userRequest };
270293
}

0 commit comments

Comments
 (0)