Skip to content

Commit 96ae8f8

Browse files
committed
fix line
1 parent 70263b6 commit 96ae8f8

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

action/index.cjs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150553,9 +150553,14 @@ const robot = (app) => {
150553150553
let side = 'RIGHT';
150554150554
// Extract line number from hunk header if available
150555150555
if (review.hunk_header) {
150556-
const hunkMatch = review.hunk_header.match(/@@\s+-\d+(?:,\d+)?\s+\+(\d+)(?:,(\d+))?\s+@@/);
150557-
if (hunkMatch) {
150558-
line = parseInt(hunkMatch[2], 10);
150556+
const c = review.hunk_header.match(/\+\s*(\d+),(\d+)/);
150557+
if (c) {
150558+
const [, start, count] = c;
150559+
line = Number(start) + Number(count) - 1;
150560+
}
150561+
else {
150562+
loglevel_1.default.error(`Failed to parse hunk header: ${review.hunk_header}`);
150563+
continue;
150559150564
}
150560150565
}
150561150566
ress.push({

0 commit comments

Comments
 (0)