Skip to content

Commit 5f9075a

Browse files
committed
Create PR if not present during sync on
1 parent 55d0430 commit 5f9075a

File tree

1 file changed

+14
-0
lines changed
  • app/commands/progress/sync

1 file changed

+14
-0
lines changed

app/commands/progress/sync/on.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
from app.utils.gh_cli_utils import (
1616
clone_with_custom_name,
1717
fork,
18+
get_prs,
1819
get_username,
1920
has_fork,
21+
pull_request,
2022
)
2123
from app.utils.git_cli_utils import add_all, add_remote, commit, push
2224
from app.utils.gitmastery_utils import (
@@ -103,6 +105,18 @@ def on(ctx: click.Context) -> None:
103105
commit("Sync progress with local machine", verbose)
104106
push("origin", "main", verbose)
105107

108+
prs = get_prs(PROGRESS_REPOSITORY_NAME, "main", username, verbose)
109+
if len(prs) == 0:
110+
warn("No pull request created for progress. Creating one now")
111+
pull_request(
112+
"git-mastery/progress",
113+
"main",
114+
f"{username}:main",
115+
f"[{username}] Progress",
116+
"Automated",
117+
verbose,
118+
)
119+
106120
success("You have setup the progress tracker for Git-Mastery!")
107121

108122
gitmastery_config["progress_remote"] = True

0 commit comments

Comments
 (0)