-
Notifications
You must be signed in to change notification settings - Fork 692
Add support for variable substitution in PR description templates #8243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
alexr00
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot continue
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>
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:
|
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.