Skip to content

Commit

Permalink
Merge Upstream Workflow | Fix PR Check (#1715)
Browse files Browse the repository at this point in the history
## Что этот PR делает
Чинит проверку на существование мерж ПРа, чтобы не сбросить чью-то
работу. Надеюсь, последний на сегодня.
  • Loading branch information
m-dzianishchyts authored Dec 25, 2024
1 parent d91797a commit ee660cd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tools/merge-upstream/merge_upstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,8 @@ def check_pull_exists(target_repo: Repository, base: str, head: str):
"""Check if the merge pull request already exists."""
logging.info("Checking if pull request already exists between '%s' and '%s'...", base, head)
owner: str = target_repo.owner.login
base_strict = f"{owner}:{base}"
head_strict = f"{owner}:{head}"
existing_pulls: PaginatedList[PullRequest] = target_repo.get_pulls(state="open", base=base_strict, head=head_strict)
existing_pulls: PaginatedList[PullRequest] = target_repo.get_pulls(state="open", base=base, head=head_strict)
if existing_pulls.totalCount > 0:
logging.error("Pull request already exists: %s", ", ".join(pull.html_url for pull in existing_pulls))
exit(1)
Expand Down

0 comments on commit ee660cd

Please sign in to comment.