Skip to main content
Standardize bug reports across your repository by adding a GitHub issue template. This reduces back-and-forth during triage, ensures consistent data from reporters (environment, steps to reproduce, logs), and speeds up fixes.
A GitHub repository page in dark mode showing the .github folder contents (CODEOWNERS and PULL_REQUEST_TEMPLATE.md) and a left file tree listing README.md, app.js, and package.json. The repo path at the top reads game-devstudio/ghas-guardrail-demo.

Why add an issue template?

  • Contributors otherwise see a blank description and may omit critical details.
  • A structured form collects environment, reproduction steps, expected vs actual behavior, version, and logs up-front.
  • Consistent reports improve triage speed and make issues easier to assign and resolve.

Best place to add the template

Put issue templates in the .github/ISSUE_TEMPLATE/ directory. Name the file bug-report.yaml (or bug-report.yml). GitHub will render the YAML into a structured form when someone opens a new issue.

Example bug report template

Place this file at .github/ISSUE_TEMPLATE/bug-report.yaml. GitHub renders the YAML as a form when creating a new issue.

Template field overview

Authoring and committing

  • Create the file at .github/ISSUE_TEMPLATE/bug-report.yaml and commit to the default branch (commonly main).
  • Verify the folder and filename are exact; GitHub requires the path to be .github/ISSUE_TEMPLATE/ to detect templates.
  • You can include multiple templates in the same directory (e.g., feature-request.yaml, security-report.yaml) to guide different kinds of issues.

What to expect in the GitHub UI

  • When a contributor clicks “New issue”, GitHub shows available templates. Selecting ”🐛 Bug Report” opens a visual form built from the YAML.
  • Required fields (e.g., reproduction steps, environment) are highlighted and cannot be submitted empty.
  • The form allows attachments (screenshots, log files) and pre-populates labels specified in labels.

Testing the template

  1. Commit bug-report.yaml to your repository’s default branch.
  2. Navigate to Issues → New issue.
  3. Choose the ”🐛 Bug Report” template and confirm the form fields match the YAML definition.
  4. Fill out the form (for example: set Environment to iOS, add Version v1.4.2, enter reproduction steps) and submit to ensure the resulting issue includes the provided data and labels.

Quick tips

  • Use clear, concise labels to integrate with existing triage workflows (e.g., severity:high, needs-repro).
  • Keep required fields to the minimum necessary for triage (too many required fields can deter contributors).
  • Consider adding a severity or impact dropdown if your team prioritizes by user impact.

Summary

Adding a structured issue template is a lightweight change that improves report quality and reduces back-and-forth during triage. Add the YAML file under .github/ISSUE_TEMPLATE/, verify the filename and path, and test by creating a new issue using the template.

Watch Video

Practice Lab