Skip to content

Commit 6c9f276

Browse files
committed
make gh pr descrition as part of merge pr
1 parent 4ce7078 commit 6c9f276

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/scripts/propose_ghstack_orig_pr.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,16 @@ def create_prs_for_orig_branch(pr_stack: List[int], repo: Repository):
100100
# The PR we want to create is then "branch_to_merge" <- gh/user/x/orig
101101
# gh/user/x/orig is the clean diff between gh/user/x/base <- gh/user/x/head
102102
orig_branch_merge_head = pr.base.ref.replace("base", "orig")
103+
104+
try:
105+
gh_pr_first_comment = pr.get_issue_comments()[0].body
106+
except:
107+
gh_pr_first_comment = ""
108+
103109
bot_metadata = f"""This PR was created by the merge bot to help merge the original PR into the main branch.
104110
ghstack PR number: https://github.com/pytorch/executorch/pull/{pr.number} by @{pr.user.login}
111+
{gh_pr_first_comment}
105112
^ Please use this as the source of truth for the PR details, comments, and reviews
106-
ghstack PR base: https://github.com/pytorch/executorch/tree/{pr.base.ref}
107-
ghstack PR head: https://github.com/pytorch/executorch/tree/{pr.head.ref}
108-
Merge bot PR base: https://github.com/pytorch/executorch/tree/{orig_branch_merge_base}
109-
Merge bot PR head: https://github.com/pytorch/executorch/tree/{orig_branch_merge_head}
110113
@diff-train-skip-merge"""
111114

112115
existing_orig_pr = repo.get_pulls(

0 commit comments

Comments
 (0)