From 72a186427265e8c2e300d4ed055c8d71a7e9b185 Mon Sep 17 00:00:00 2001 From: RobertRadi <78905316+radirobi@users.noreply.github.com> Date: Thu, 8 May 2025 09:22:36 +0200 Subject: [PATCH 1/2] differentiate comment based on line --- libs/utils.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libs/utils.py b/libs/utils.py index 5275de7..29e0760 100644 --- a/libs/utils.py +++ b/libs/utils.py @@ -257,13 +257,16 @@ def create_review_comment( payload = { 'body': content, 'commit_id': commit_sha, - 'path': path, - 'line': line, + 'path': path 'side': 'RIGHT' } - if start_line: - payload['start_line'] = start_line - payload['start_side'] = 'RIGHT' + if line == -1: + payload['subject_type'] = 'file' + else: + payload['line'] = line + if start_line: + payload['start_line'] = start_line + payload['start_side'] = 'RIGHT' try: r = requests.post( From 47daa5062841a39820fab880b83987ff1c45509b Mon Sep 17 00:00:00 2001 From: RobertRadi <78905316+radirobi@users.noreply.github.com> Date: Thu, 8 May 2025 09:24:23 +0200 Subject: [PATCH 2/2] added missing comma --- libs/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/utils.py b/libs/utils.py index 29e0760..9becb04 100644 --- a/libs/utils.py +++ b/libs/utils.py @@ -257,7 +257,7 @@ def create_review_comment( payload = { 'body': content, 'commit_id': commit_sha, - 'path': path + 'path': path, 'side': 'RIGHT' } if line == -1: