Skip to content

Commit d384e0f

Browse files
committed
Only set node_id for comments that don't exist yet
1 parent 400de2f commit d384e0f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

image/src/github_pr_comment/comment.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ def update_comment(
374374
if comment.comment_url is not None:
375375
response = github.patch(comment.comment_url, json={'body': _to_api_payload(new_comment)})
376376
response.raise_for_status()
377-
comment.node_id = response.json().get('node_id')
377+
if comment.node_id is None:
378+
comment.node_id = response.json().get('node_id')
378379
else:
379380
response = github.post(comment.issue_url + '/comments', json={'body': _to_api_payload(new_comment)})
380381
response.raise_for_status()

0 commit comments

Comments
 (0)