From 7e82250409c9d14450dba956f98fb51002874276 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Wed, 13 Dec 2023 14:52:53 +0900 Subject: [PATCH] Fix for .ci/create-changes-html.sh --- .ci/create-changes-html.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.ci/create-changes-html.sh b/.ci/create-changes-html.sh index 1a6fbeef27b..cce6c45acac 100755 --- a/.ci/create-changes-html.sh +++ b/.ci/create-changes-html.sh @@ -69,12 +69,14 @@ for block in diff_blocks: count = 0 for line in block.splitlines(): if line.startswith('@@ -'): - line_number = int(re.search(r'@@ -(\d+)', line).group(1)) - for i in range(line_number, -1, -1): - if content[i].startswith('<'): - count += 1 - content[i] = f'' + content[i] - break + search_result = re.search(r'@@ -(\d+),(\d+) \+(\d+),(\d+)', line) + if search_result: + line_number = int(search_result.group(3)) + for i in range(line_number - 1, -1, -1): + if content[i].startswith('<'): + count += 1 + content[i] = f'' + content[i] + break with open(file_path, 'w') as file: file.writelines(content) hunks = ' '.join(f'#{i + 1}' for i in range(count))