@@ -148,6 +148,12 @@ func runSubmit(cfg *config.Config, opts *submitOptions) error {
148148 cfg .Warningf ("Failed to fetch branches from %s: %v" , remote , err )
149149 }
150150
151+ // Look up the repository's PR template once before creating any PRs.
152+ var templateContent string
153+ if repoRoot , err := git .RootDir (); err == nil {
154+ templateContent = findPRTemplate (repoRoot )
155+ }
156+
151157 // Push each branch and create/update its PR in stack order (bottom to top).
152158 // Sequential pushing ensures each branch's base is up-to-date on the
153159 // remote before the next branch is pushed, preventing race conditions.
@@ -165,7 +171,7 @@ func runSubmit(cfg *config.Config, opts *submitOptions) error {
165171
166172 // Find or create PR, and fix base if needed
167173 baseBranch := s .ActiveBaseBranch (b .Branch )
168- if err := ensurePR (cfg , client , s , i , baseBranch , opts ); err != nil {
174+ if err := ensurePR (cfg , client , s , i , baseBranch , opts , templateContent ); err != nil {
169175 if errors .Is (err , errInterrupt ) {
170176 printInterrupt (cfg )
171177 return ErrSilent
@@ -195,7 +201,7 @@ func runSubmit(cfg *config.Config, opts *submitOptions) error {
195201// ensurePR finds or creates a PR for the branch at index i, and updates
196202// its base branch if needed. This is the single place where PR state is
197203// reconciled during submit.
198- func ensurePR (cfg * config.Config , client github.ClientOps , s * stack.Stack , i int , baseBranch string , opts * submitOptions ) error {
204+ func ensurePR (cfg * config.Config , client github.ClientOps , s * stack.Stack , i int , baseBranch string , opts * submitOptions , templateContent string ) error {
199205 b := s .Branches [i ]
200206
201207 pr , err := client .FindPRForBranch (b .Branch )
@@ -205,7 +211,7 @@ func ensurePR(cfg *config.Config, client github.ClientOps, s *stack.Stack, i int
205211 }
206212
207213 if pr == nil {
208- return createPR (cfg , client , s , i , baseBranch , opts )
214+ return createPR (cfg , client , s , i , baseBranch , opts , templateContent )
209215 }
210216
211217 // PR exists — record it and fix base if needed.
@@ -250,7 +256,7 @@ func ensurePR(cfg *config.Config, client github.ClientOps, s *stack.Stack, i int
250256}
251257
252258// createPR creates a new PR for the branch at index i.
253- func createPR (cfg * config.Config , client github.ClientOps , s * stack.Stack , i int , baseBranch string , opts * submitOptions ) error {
259+ func createPR (cfg * config.Config , client github.ClientOps , s * stack.Stack , i int , baseBranch string , opts * submitOptions , templateContent string ) error {
254260 b := s .Branches [i ]
255261
256262 title , commitBody := defaultPRTitleBody (baseBranch , b .Branch )
@@ -272,7 +278,7 @@ func createPR(cfg *config.Config, client github.ClientOps, s *stack.Stack, i int
272278 if title != originalTitle && commitBody != "" {
273279 prBody = originalTitle + "\n \n " + commitBody
274280 }
275- body := generatePRBody (prBody )
281+ body := generatePRBody (prBody , templateContent )
276282
277283 newPR , createErr := client .CreatePR (baseBranch , b .Branch , title , body , ! opts .open )
278284 if createErr != nil {
@@ -299,9 +305,14 @@ func defaultPRTitleBody(base, head string) (string, string) {
299305 return humanize (head ), ""
300306}
301307
302- // generatePRBody builds a PR description from the commit body (if any)
303- // and a footer linking to the CLI and feedback form.
304- func generatePRBody (commitBody string ) string {
308+ // generatePRBody builds a PR description. When a templateContent is provided,
309+ // it is used as the body and the attribution footer is omitted. Otherwise the
310+ // body is built from the commit body with a footer linking to the CLI.
311+ func generatePRBody (commitBody string , templateContent string ) string {
312+ if templateContent != "" {
313+ return templateContent
314+ }
315+
305316 var parts []string
306317
307318 if commitBody != "" {
0 commit comments