Add YAML issue template support
VSCode extension only recognized Markdown (.md) issue templates, forcing users to maintain duplicate YAML templates for GitHub Web and Markdown templates for the extension.
Changes
Template Discovery (folderRepositoryManager.ts)
- Modified
getIssueTemplates()to scan for both.mdand.ymlfiles using parallel promises
Template Parsing (issueFeatureRegistrar.ts)
- Enhanced
getDataFromTemplate()to detect YAML templates via js-yaml parser - Added
parseYamlTemplate()to convert YAML body fields to markdown sections - YAML detection validates presence of both
nameandbodyfields before treating as template - Falls back to Markdown frontmatter parsing if YAML parsing fails
Type Definitions (util.ts)
- Added
YamlIssueTemplateandYamlTemplateFieldinterfaces for type safety
Dependencies (package.json)
- Added
js-yamlruntime dependency - Added
@types/js-yamldev dependency
Example
A YAML template like:
name: Bug Report
description: File a bug report
title: "[Bug]: "
body:
- type: textarea
id: description
attributes:
label: What happened?
description: Tell us what you see
- type: dropdown
id: version
attributes:
label: Version
options: ["1.0.0", "1.1.0"]
Now appears in template selection and converts body fields to markdown sections for issue creation.
Original prompt
This section details on the original issue you should resolve
<issue_title>[Feature Request] Support YAML format issue templates</issue_title> <issue_description>## Feature Request
Description
I'd like to request support for YAML format (.yml) issue templates in the GitHub Pull Requests and Issues extension. Currently, the extension only recognizes Markdown (.md) templates but not YAML templates that are placed in the
.github/ISSUE_TEMPLATE/directory.Current Behavior
When creating a new issue via the VSCode extension:
- Only Markdown (.md) templates in
.github/ISSUE_TEMPLATE/are recognized and displayed- YAML (.yml) templates in the same directory are completely ignored
- This creates a situation where we need to maintain two sets of templates (YAML for GitHub Web and Markdown for VSCode)
Expected Behavior
- The extension should recognize and display both YAML and Markdown issue templates
- Ideally, render YAML templates as forms similar to GitHub Web, but if technically challenging, displaying them in YAML format would also be acceptable
- Allow selection from all available templates regardless of format
Current Directory Structure and Workaround
Currently, we're maintaining duplicate templates in both formats:
.github/ └── ISSUE_TEMPLATE/ ├── BUG-REPORT.yml # For GitHub Web (not displayed in VSCode) ├── BUG-REPORT.md # For VSCode (displayed) ├── FEATURE-REQUEST.yml # For GitHub Web (not displayed in VSCode) ├── FEATURE-REQUEST.md # For VSCode (displayed) └── config.yml # Template configurationThis is not ideal as it requires keeping both versions in sync manually. If the extension supported YAML format templates, we wouldn't need to maintain duplicate templates. </issue_description>
Comments on the Issue (you are @copilot in this section)
- Fixes microsoft/vscode-pull-request-github#6722
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.