Skip to content

Commit

Permalink
Fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
DonggeLiu committed Sep 13, 2023
1 parent b28e602 commit 663af20
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions service/gcbrun_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ def get_comments(pull_request_number):
repo = github_obj.get_repo('google/fuzzbench')
pull = repo.get_pull(pull_request_number)
pull_comments = list(pull.get_comments())
last_pull_comment = pull_comments[-1] if pull_comments else ''
last_pull_comment = pull_comments[-1] if pull_comments else None
issue = repo.get_issue(pull_request_number)
issue_comments = list(issue.get_comments())
last_issue_comment = issue_comments[-1] if issue_comments else ''
last_issue_comment = issue_comments[-1] if issue_comments else None
# Github only returns comments if from the pull object when a pull request
# is open. If it is a draft, it will only return comments from the issue
# object.
Expand All @@ -50,6 +50,8 @@ def get_comments(pull_request_number):
def get_latest_gcbrun_command(comment):
"""Gets the last /gcbrun comment from comments."""
# This seems to get comments on code too.
if comment is None:
return None
body = comment.body
if body.startswith(SKIP_COMMAND_STR):
return None
Expand Down

0 comments on commit 663af20

Please sign in to comment.