From d384e0f41efde4264b52a54419242e0d49b7a84d Mon Sep 17 00:00:00 2001 From: Daniel Flook Date: Thu, 1 Aug 2024 18:01:26 +0100 Subject: [PATCH] Only set node_id for comments that don't exist yet --- image/src/github_pr_comment/comment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/image/src/github_pr_comment/comment.py b/image/src/github_pr_comment/comment.py index 36b1f1d0..b58df988 100644 --- a/image/src/github_pr_comment/comment.py +++ b/image/src/github_pr_comment/comment.py @@ -374,7 +374,8 @@ def update_comment( if comment.comment_url is not None: response = github.patch(comment.comment_url, json={'body': _to_api_payload(new_comment)}) response.raise_for_status() - comment.node_id = response.json().get('node_id') + if comment.node_id is None: + comment.node_id = response.json().get('node_id') else: response = github.post(comment.issue_url + '/comments', json={'body': _to_api_payload(new_comment)}) response.raise_for_status()