File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
eden/scm/sapling/ext/github Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -422,6 +422,19 @@ async def create_serial_strategy_params(
422422 return SerialStrategyParams (refs_to_update , pull_requests_to_create , repository )
423423
424424
425+ def get_pull_request_template (commit : CommitData ) -> None | str :
426+ change_context = commit .ctx
427+ for path in [".github/pull_request_template.md" , "pull_request_template.md" ]:
428+ try :
429+ file_context = change_context .filectx (path )
430+ bytes = file_context .data ()
431+ return str (bytes , "utf-8" )
432+ except :
433+ pass # Ignore error when file is not found
434+
435+ return None
436+
437+
425438async def create_pull_requests_serially (
426439 commits : List [Tuple [CommitData , str ]],
427440 workflow : SubmitWorkflow ,
@@ -450,6 +463,8 @@ async def create_pull_requests_serially(
450463
451464 commit_msg = commit .get_msg ()
452465 title , body = title_and_body (commit_msg )
466+ pull_request_template = get_pull_request_template (commit )
467+ body = "\n \n " .join (filter (None , [body , pull_request_template ]))
453468 result = await gh_submit .create_pull_request (
454469 hostname = repository .hostname ,
455470 owner = owner ,
You can’t perform that action at this time.
0 commit comments