Skip to content

Commit

Permalink
Don't try and hide comments if we don't know the id
Browse files Browse the repository at this point in the history
  • Loading branch information
dflook committed Aug 1, 2024
1 parent b5f0b5b commit 400de2f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions image/src/github_pr_comment/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ 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')
else:
response = github.post(comment.issue_url + '/comments', json={'body': _to_api_payload(new_comment)})
response.raise_for_status()
Expand All @@ -388,6 +389,10 @@ def hide_comment(
classifier: str
) -> None:

if comment.node_id is None:
debug('Comment has unknown node_id - not hiding')
return

graphql_url = os.environ.get('GITHUB_GRAPHQL_URL', f'{os.environ["GITHUB_API_URL"]}/graphql')

response = github.post(
Expand Down

0 comments on commit 400de2f

Please sign in to comment.