Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

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 .md and .yml files 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 name and body fields before treating as template
  • Falls back to Markdown frontmatter parsing if YAML parsing fails

Type Definitions (util.ts)

  • Added YamlIssueTemplate and YamlTemplateField interfaces for type safety

Dependencies (package.json)

  • Added js-yaml runtime dependency
  • Added @types/js-yaml dev 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 configuration

This 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)


💡 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.

Copilot AI changed the title [WIP] Add support for YAML format issue templates Add YAML issue template support Dec 10, 2025
Copilot AI requested a review from alexr00 December 10, 2025 15:10
@alexr00 alexr00 marked this pull request as ready for review December 15, 2025 11:13
@alexr00 alexr00 enabled auto-merge (squash) December 15, 2025 11:13
@vs-code-engineering vs-code-engineering bot added this to the December / January 2026 milestone Dec 15, 2025
new vscode.RelativePattern(this._repository.rootUri, pattern), null
);
const mdPattern = '{docs,.github}/ISSUE_TEMPLATE/*.md';
const ymlPattern = '{docs,.github}/ISSUE_TEMPLATE/*.yml';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not be more efficient to do '{docs,.github}/ISSUE_TEMPLATE/*.{md,yml}' as a single pattern?

@alexr00 alexr00 merged commit 1737796 into main Dec 15, 2025
6 checks passed
@alexr00 alexr00 deleted the copilot/add-yaml-issue-template-support branch December 15, 2025 11:18
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.

[Feature Request] Support YAML format issue templates

3 participants