Skip to content

Commit 400de2f

Browse files
committed
Don't try and hide comments if we don't know the id
1 parent b5f0b5b commit 400de2f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

image/src/github_pr_comment/comment.py

+5
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ 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')
377378
else:
378379
response = github.post(comment.issue_url + '/comments', json={'body': _to_api_payload(new_comment)})
379380
response.raise_for_status()
@@ -388,6 +389,10 @@ def hide_comment(
388389
classifier: str
389390
) -> None:
390391

392+
if comment.node_id is None:
393+
debug('Comment has unknown node_id - not hiding')
394+
return
395+
391396
graphql_url = os.environ.get('GITHUB_GRAPHQL_URL', f'{os.environ["GITHUB_API_URL"]}/graphql')
392397

393398
response = github.post(

0 commit comments

Comments
 (0)