Add support for variable substitution in PR description templates#8243
Draft
Add support for variable substitution in PR description templates#8243
Conversation
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot stopped work on behalf of
alexr00 due to an error
December 9, 2025 11:38
alexr00
requested changes
Dec 18, 2025
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>
Contributor
Author
I've completed the implementation of variable substitution for PR description templates. The changes enable templates to use variables like Key changes in commit 1c30005:
All linting, hygiene checks, code review, and security scans passed successfully. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot
AI
changed the title
[WIP] Add support for templating in PR description templates
Add support for variable substitution in PR description templates
Dec 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for variable substitution in PR title and description templates. Users can now use variables like
${issueNumberLabel},${issueTitle},${issueNumber},${user},${repository}, and${owner}in their PR description templates, and they will be automatically replaced with actual values when creating a PR.Changes Made
getTitleAndDescription()method insrc/github/createPRViewProvider.tsto apply variable substitution to both PR title and description using the existingvariableSubstitution()functionactiveIssueproperty fromFolderRepositoryManagerto provide issue context for variable replacementgetCurrentUser()call to prevent errors from breaking PR creation flowvariableSubstitution()function insrc/test/github/utils.test.tsSupported Variables
${issueNumberLabel}- Issue reference (e.g.,#123orowner/repo#123)${issueNumber}- Just the issue number (e.g.,123)${issueTitle}- The issue title${user}- Current user's username${repository}- Repository name${owner}- Repository ownerExample
Template:
Closes ${issueNumberLabel} ## Changes Working on ${issueTitle}Expands to:
Testing
This implementation makes it easier to track and link pull requests to the issues they're associated with, especially when using many small issues in a ticket-like way.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.