Skip to content

Commit

Permalink
Add better checking
Browse files Browse the repository at this point in the history
  • Loading branch information
neubig committed Aug 28, 2024
1 parent 1f79d10 commit 98b60e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions github_resolver/send_pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,15 @@ def send_pull_request(
github_token = (
my_args.github_token if my_args.github_token else os.getenv("GITHUB_TOKEN")
)
if not github_token:
raise ValueError("Github token is not set, set via --github-token or GITHUB_TOKEN environment variable.")
github_username = (
my_args.github_username
if my_args.github_username
else os.getenv("GITHUB_USERNAME")
)
if not github_username:
raise ValueError("Github username is not set, set via --github-username or GITHUB_USERNAME environment variable.")

if not os.path.exists(my_args.output_dir):
raise ValueError(f"Output directory {my_args.output_dir} does not exist.")
Expand Down

0 comments on commit 98b60e7

Please sign in to comment.