Skip to content

Use GitHub PR template file when creating pull requests#1209

Open
opsengine wants to merge 1 commit intofacebook:mainfrom
opsengine:github-template
Open

Use GitHub PR template file when creating pull requests#1209
opsengine wants to merge 1 commit intofacebook:mainfrom
opsengine:github-template

Conversation

@opsengine
Copy link

Use GitHub PR template file when creating pull requests

Summary

This PR makes sl pr submit respect the standard GitHub pull request template file (.github/pull_request_template.md) when creating pull requests, matching GitHub's native behavior.

Previously, Sapling would ignore the PR template and use the commit message body (or append the template to it), which was inconsistent with how GitHub's web UI works.

Changes

  • Read PR template from working directory instead of the commit context, so the template is found regardless of which commits are being submitted
  • Use template as the PR body instead of appending it to the commit message
  • Add config option github.pull-request-template to customize the template path or disable the feature
  • Fix placeholder strategy which previously ignored templates entirely

Config Options

[github]
# Use a custom template path
pull-request-template = my/custom/template.md

# Disable PR templates entirely  
pull-request-template = 

When not configured, checks standard GitHub locations:

  • .github/pull_request_template.md
  • docs/pull_request_template.md
  • pull_request_template.md

This is consistent with the GitHub documentation https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository

Test Plan

  1. Create a repo with .github/pull_request_template.md
  2. Make a commit and run sl pr submit
  3. Verify the PR body contains the template content (not the commit message body)

@meta-cla meta-cla bot added the CLA Signed label Feb 6, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 6, 2026

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this in D92479985. (Because this pull request was imported automatically, there will not be any future comments.)

@bherila
Copy link
Contributor

bherila commented Feb 6, 2026

FYI I have been using node 24 for development and testing, we can update that too if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants