Add commits-since function
This commit is contained in:
@@ -23,6 +23,14 @@ def commit_in_branch(commit_sha: str, branch: str) -> bool:
|
||||
return False
|
||||
|
||||
|
||||
def commits_since(first_ref: str, last_ref: str) -> int:
|
||||
url = f"https://api.github.com/repos/NixOS/nixpkgs/compare/{first_ref}...{last_ref}"
|
||||
commit_response = requests.get(url, headers=DEFAULT_HEADERS)
|
||||
commit_response.raise_for_status()
|
||||
|
||||
return commit_response.json()["behind_by"]
|
||||
|
||||
|
||||
def pr_merge_status(pr: int, branches: list[str] = DEFAULT_BRANCHES) -> PRStatus:
|
||||
url = f"https://api.github.com/repos/NixOS/nixpkgs/pulls/{pr}"
|
||||
pr_response = requests.get(url, headers=DEFAULT_HEADERS)
|
||||
|
||||
Reference in New Issue
Block a user