Skip to content

Commit

Permalink
Only set node_id for comments that don't exist yet
Browse files Browse the repository at this point in the history
  • Loading branch information
dflook committed Aug 1, 2024
1 parent 400de2f commit d384e0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion image/src/github_pr_comment/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d384e0f

Please sign in to comment.