Skip to content

Commit

Permalink
Merge pull request #1494 from hlohaus/neww
Browse files Browse the repository at this point in the history
No PR number found
  • Loading branch information
hlohaus authored Jan 21, 2024
2 parents 4f18d86 + 04ec265 commit c809346
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion etc/tool/copilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ def get_pr_details(github: Github) -> PullRequest:
"""
'./pr_number'
with open('./pr_number', 'r') as file:
pr_number = file.read()
pr_number = int(file.read())
if not pr_number:
return

repo = github.get_repo(GITHUB_REPOSITORY)
pull = repo.get_pull(pr_number)
Expand Down Expand Up @@ -214,6 +216,9 @@ def main():
try:
github = Github(GITHUB_TOKEN)
pull = get_pr_details(github)
if not pull:
print(f"No PR number found")
exit()
diff = get_diff(pull.diff_url)
except Exception as e:
print(f"Error get details: {e.__class__.__name__}: {e}")
Expand Down

0 comments on commit c809346

Please sign in to comment.