Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

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 branchName enum value to githubPullRequests.pullRequestDescription setting
  • Localization: Added description "Use the branch name as the pull request title"
  • Implementation: Early return in getTitleAndDescription() when branchName is selected, using capitalized branch name as title with empty description
  • Type safety: Updated type unions in createPRViewProvider.ts to 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.pullRequestDescription setting for branchName. </agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits December 10, 2025 14:35
…etting

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Add option to set PR title from branch name Add branchName option to pullRequestDescription setting Dec 10, 2025
Copilot AI requested a review from alexr00 December 10, 2025 14:50
@alexr00 alexr00 marked this pull request as ready for review December 15, 2025 17:06
@alexr00 alexr00 enabled auto-merge (squash) December 15, 2025 17:06
@vs-code-engineering vs-code-engineering bot added this to the December / January 2026 milestone Dec 15, 2025
@alexr00 alexr00 merged commit 6436221 into main Dec 15, 2025
6 checks passed
@alexr00 alexr00 deleted the copilot/add-pr-title-from-branch-name branch December 15, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Name of PR can't be set automatically based on branch name any more

3 participants