summaryrefslogtreecommitdiffstats
path: root/etc/tool
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-21 17:38:26 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-21 17:38:26 +0100
commitf5ab6f85311b0a28ca0702ae8e079b2a3322f81a (patch)
tree9142df07abd61ac1d2064acb248672d98a177281 /etc/tool
parentFirst checkout repo (diff)
downloadgpt4free-f5ab6f85311b0a28ca0702ae8e079b2a3322f81a.tar
gpt4free-f5ab6f85311b0a28ca0702ae8e079b2a3322f81a.tar.gz
gpt4free-f5ab6f85311b0a28ca0702ae8e079b2a3322f81a.tar.bz2
gpt4free-f5ab6f85311b0a28ca0702ae8e079b2a3322f81a.tar.lz
gpt4free-f5ab6f85311b0a28ca0702ae8e079b2a3322f81a.tar.xz
gpt4free-f5ab6f85311b0a28ca0702ae8e079b2a3322f81a.tar.zst
gpt4free-f5ab6f85311b0a28ca0702ae8e079b2a3322f81a.zip
Diffstat (limited to 'etc/tool')
-rw-r--r--etc/tool/copilot.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/etc/tool/copilot.py b/etc/tool/copilot.py
index 21f54d6d..8c63c4ea 100644
--- a/etc/tool/copilot.py
+++ b/etc/tool/copilot.py
@@ -33,6 +33,8 @@ def get_pr_details(github: Github) -> PullRequest:
'./pr_number'
with open('./pr_number', 'r') as file:
pr_number = file.read()
+ if not pr_number:
+ return
repo = github.get_repo(GITHUB_REPOSITORY)
pull = repo.get_pull(pr_number)
@@ -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}")