From aca8da1a7917f09190f1d14f2f7b9d149522eea5 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Mon, 21 Oct 2024 17:53:10 -0700 Subject: [PATCH] ghstack bot skip if a corresponding PR is merged If a corresponding fixup PR is merged, the bot should not attempt to create a duplicated one ghstack-source-id: 99e176c59cefda7ab8a811f1033a5a617d69be1f Pull Request resolved: https://github.com/pytorch/executorch/pull/6426 --- .github/scripts/propose_ghstack_orig_pr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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]}" )