diff --git a/.github/scripts/propose_ghstack_orig_pr.py b/.github/scripts/propose_ghstack_orig_pr.py index b6706f6c9eb..7e1ac964a11 100644 --- a/.github/scripts/propose_ghstack_orig_pr.py +++ b/.github/scripts/propose_ghstack_orig_pr.py @@ -112,9 +112,9 @@ def create_prs_for_orig_branch(pr_stack: List[int], repo: Repository): existing_orig_pr = repo.get_pulls( head="pytorch:" + orig_branch_merge_head, base=orig_branch_merge_base, - state="open", + state="all", ) - if existing_orig_pr.totalCount > 0: + if existing_orig_pr.totalCount > 0 and existing_orig_pr[0].title == pr.title: print( f"PR for {orig_branch_merge_head} already exists {existing_orig_pr[0]}" )