multi-pr #21
@ -19,7 +19,7 @@ BRANCHES = ["nixos-unstable-small", "nixos-unstable", "nixos-24.05"]
|
||||
|
||||
@app.command()
|
||||
def pr(
|
||||
pr: int,
|
||||
pr: list[int],
|
||||
branches: Annotated[
|
||||
list[str] | None, typer.Option(help="Check specific branch")
|
||||
] = None,
|
||||
@ -28,12 +28,15 @@ def pr(
|
||||
] = OutputFormat.CONSOLE,
|
||||
) -> None:
|
||||
"""Get merge status of pull request."""
|
||||
if branches:
|
||||
if isinstance(pr, int):
|
||||
status = pr_merge_status(pr, branches)
|
||||
else:
|
||||
status = pr_merge_status(pr)
|
||||
status.print(format=format)
|
||||
return
|
||||
|
||||
status.print(format=format)
|
||||
for pr_ in pr:
|
||||
status = pr_merge_status(pr_, branches)
|
||||
status.print(format=format)
|
||||
print()
|
||||
|
||||
|
||||
@app.command()
|
||||
|
@ -75,6 +75,8 @@ def get_pr(pr: int) -> dict[str, Any]:
|
||||
def pr_merge_status(
|
||||
pr: int, branches: list[str] = DEFAULT_BRANCHES, check_backport: bool = True
|
||||
) -> PRStatus:
|
||||
if not branches:
|
||||
branches = DEFAULT_BRANCHES
|
||||
url = f"https://api.github.com/repos/NixOS/nixpkgs/pulls/{pr}"
|
||||
pr_response = requests.get(url, headers=DEFAULT_HEADERS)
|
||||
pr_response.raise_for_status()
|
||||
|
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "nixprstatus"
|
||||
version = "0.1.15"
|
||||
version = "0.1.16"
|
||||
description = "Nixpkgs PR status checker"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.12"
|
||||
|
Loading…
Reference in New Issue
Block a user