Is there a Pull request Template selector similar to issues?

I would really love to use multiple Pull request Templates for my project to have it easier to get specific information depending on what part of the project is being changed.

The question now is, does GitHub support PR templates similar to having multiple issue templates, as in having a template selector?
From what I gathered so far, which is basically this section of a docs page here can you have multiple templates in a PULL_REQUEST_TEMPLATE folder, but from my understanding would it only allow selection of other templates through query-patameters (The template= one)?

Some questions coming up in my head from this:

  • How does GitHub determine which template to use as default when making a PR?
    • Does it even select a default one?
  • Can I add frontmatter to the templates to make GitHub auto-generate the template-chooser?
    • If that isn’t a thing, why was it never considered by GitHub so far? This seems like a pretty obvious thing to have available.

Thanks for your responses to this.

5 Likes

The default file is pull_request_template.md and can be located in any of the supported locations. Any files within .github/PULL_REQUEST_TEMPLATE can only be accessed via the template query parameter and no default will be chosen.

There is no template chooser available at this time, We really appreciate your feedback on this feature and will certainly pass it on to the appropriate team.

I second this – it would be a really useful feature. @kwacky1 can you give an estimate as to when it might be available for GitHub Enterprise? Thanks

2 Likes

I agree, being able to use a template selector would make multiple PR templates far more usable than it is today.

Currently it seems like the only way multiple templates can be used is to manually add the template=abc.md query parameter after selecting the compare branches. I can’t even create a link such as https://github.com/org/repo/compare/?template=pull-request-template-abc.md because as soon as I select the compare branches the template param is discarded = useless.

4 Likes

I agree, it’d be a great feature to have

2 Likes

Has an issue been created for this yet? Just to weigh in, it seems like a logical progression to the feature set.

Back in 2014 / 2015, using the template query-param was the original way to access templated issues. Since then we got the issues/new/choose endpoint for issue templates and then we got yml forms but pull request templates are still using the old, old way.

A built-in selector pulls/compare/a ... b/choose displayed if PULL_REQUEST_TEMPLATE has more than one template in it and then just appending the appropriate template query-param and redirecting the user.

The rest of the logic would likely follow the same flow as issue templates through the local .github (or docs, etc.) folder and then through the account’s global .github repository, if they have one, finally displaying a blank pull request if none of those paths matched.

1 Like