Add branchName option to pullRequestDescription setting
Users need to automatically set PR titles from branch names to preserve ticket numbers embedded in branch names for automation workflows. Previously, only commit messages, templates, or Copilot-generated titles were available.
Changes
-
Configuration: Added
branchNameenum value togithubPullRequests.pullRequestDescriptionsetting - Localization: Added description "Use the branch name as the pull request title"
-
Implementation: Early return in
getTitleAndDescription()whenbranchNameis selected, using capitalized branch name as title with empty description -
Type safety: Updated type unions in
createPRViewProvider.tsto include'branchName'
Behavior
When githubPullRequests.pullRequestDescription is set to "branchName":
// Branch: "feature/JIRA-123-add-validation"
// Result: title = "Feature/JIRA-123-add-validation", description = ""
This preserves the full branch name (including ticket identifiers) as the PR title, enabling downstream automation that parses these identifiers.
Original prompt
This section details on the original issue you should resolve
<issue_title>Name of PR can't be set automatically based on branch name any more</issue_title> <issue_description>I found this issue where it's stated that this PR allows people to select in the settings that default title for the PR is taken from branch, what is the default of what GH does in the web UI.
I can't see it any more and the PR title is set to the commit message. It is a best practice to include the ticket number in the branch name, and various automations are based on having the ticket number in the PR name, so setting the PR title to the branch name seems reasonable. </issue_description>
<agent_instructions>Add an option to the
githubPullRequests.pullRequestDescriptionsetting forbranchName. </agent_instructions>Comments on the Issue (you are @copilot in this section)
- Fixes microsoft/vscode-pull-request-github#6663
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.