Skip to content

Commit 605f957

Browse files
committed
Fix logging for existing PRs
1 parent abf05fc commit 605f957

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/src/scverse_template_scripts/cruft_prs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def make_pr(con: GitHubConnection, release: GHRelease, repo_url: str) -> None:
223223
origin = con.gh.get_repo(repo_url.removeprefix("https://github.com/"))
224224
repo = get_fork(con, origin)
225225

226-
if any(True for p in origin.get_pulls("open") if pr.matches_current_version(p)):
226+
if old_pr := next((p for p in origin.get_pulls("open") if pr.matches_current_version(p)), None):
227227
log.info(
228228
f"PR for current version already exists: #{old_pr.number} with branch name `{old_pr.head.ref}`. Skipping."
229229
)

0 commit comments

Comments
 (0)