mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-12-25 12:16:17 +03:00
commit
c809346b43
@ -32,7 +32,9 @@ def get_pr_details(github: Github) -> PullRequest:
|
|||||||
"""
|
"""
|
||||||
'./pr_number'
|
'./pr_number'
|
||||||
with open('./pr_number', 'r') as file:
|
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)
|
repo = github.get_repo(GITHUB_REPOSITORY)
|
||||||
pull = repo.get_pull(pr_number)
|
pull = repo.get_pull(pr_number)
|
||||||
@ -214,6 +216,9 @@ def main():
|
|||||||
try:
|
try:
|
||||||
github = Github(GITHUB_TOKEN)
|
github = Github(GITHUB_TOKEN)
|
||||||
pull = get_pr_details(github)
|
pull = get_pr_details(github)
|
||||||
|
if not pull:
|
||||||
|
print(f"No PR number found")
|
||||||
|
exit()
|
||||||
diff = get_diff(pull.diff_url)
|
diff = get_diff(pull.diff_url)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error get details: {e.__class__.__name__}: {e}")
|
print(f"Error get details: {e.__class__.__name__}: {e}")
|
||||||
|
Loading…
Reference in New Issue
Block a user