Skip to content

Commit 20dc779

Browse files
committed
fix: swap to just checking return code
1 parent 64091d9 commit 20dc779

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

scripts/update-demo.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,8 @@ def _create_demo_pr(demo_path: Path, branch: str, commit_start: str) -> None:
148148
"""Creates a PR to merge the given branch into develop."""
149149
gh("repo", "set-default", f"{DEMO.app_author}/{DEMO.app_name}")
150150
search_results: subprocess.CompletedProcess = gh("pr", "list", "--state", "open", "--search", branch)
151-
typer.secho(f"_create_demo_pr - {search_results.stdout=}")
152151

153-
if "no pull requests" not in str(search_results.stdout):
154-
typer.secho(f"{str(search_results.stdout)=}")
155-
typer.secho(f"no_pull_requests")
152+
if search_results.returncode != 0:
156153
url: str = _get_pr_url(branch=branch)
157154
typer.secho(f"Skipping PR creation due to existing PR found for branch {branch} at {url}")
158155
return
@@ -172,7 +169,6 @@ def _create_demo_pr(demo_path: Path, branch: str, commit_start: str) -> None:
172169
def _get_pr_url(branch: str) -> str:
173170
"""Returns the url of the current branch's PR."""
174171
result: subprocess.CompletedProcess = gh("pr", "view", branch, "--json", "url", "--jq", ".url")
175-
typer.secho(f"_get_pr_url - {result.stdout=}")
176172
if result.returncode != 0:
177173
raise ValueError(f"Failed to find a PR URL for branch {branch}.")
178174
return result.stdout.strip()

0 commit comments

Comments
 (0)