Skip to content

Commit

Permalink
Add check for default branch
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Sep 23, 2024
1 parent 14e9e10 commit 5f1c3c0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/autoreviewer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ def get_has_issues(owner: str, name: str) -> bool:
def get_default_branch(owner: str, name: str) -> str:
"""Get the default branch for a GitHub repository."""
res = get_repo_metadata(f"{owner}/{name}")
if "default_branch" not in res:
raise KeyError(f"No default branch found in response:\n{json.dumps(res, indent=2)}")
return res["default_branch"]


Expand Down

0 comments on commit 5f1c3c0

Please sign in to comment.