Skip to content

open_prs

Functions for open-prs command.

open_prs(state, override, max_prs, target_branch_name, commit_message)

Opens PRs.

Source code in dapla_team_cli/pr/open/open_prs.py
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
@batch_handler
def open_prs(state: State, override: bool, max_prs: int, target_branch_name: str, commit_message: str) -> None:
    """Opens PRs."""
    opened_prs = 0
    print("\n\n[cyan]Opening PRs..")
    for repo in state.repos.values():
        if opened_prs >= max_prs:
            print("[blue] Max PRs opened, stopping")
            break

        print(f"[bold magenta]{repo.name}")

        if (
            _check_override(repo, override)
            and _do_push_repo(repo, target_branch_name, commit_message)
            and _do_open_pr(repo, target_branch_name, commit_message)
        ):
            opened_prs += 1