require-github-issue-template-labels
Require labels in GitHub issue template YAML files.
Targeted pattern scopeâ
This rule reads each *.yml / *.yaml GitHub issue form file inside
.github/ISSUE_TEMPLATE/ and checks that the top-level YAML document contains a
labels: key. It intentionally ignores config.yml / config.yaml, which are
GitHub issue template settings files rather than issue forms.
What this rule reportsâ
This rule reports GitHub issue form files that do not declare a top-level
labels: field.
Why this rule existsâ
GitHub issue templates with labels automatically apply those labels when the
issue is opened, enabling triage automation, board views, and SLA tracking.
Without labels, issues land in a triage backlog with no categorisation, and teams
must manually label every issue â a tedious and error-prone process that leads to
label drift.
â Incorrectâ
# .github/ISSUE_TEMPLATE/bug_report.yml
name: Bug Report
description: Report a bug
body:
- type: input
id: title
attributes:
label: Summary
â Correctâ
# .github/ISSUE_TEMPLATE/bug_report.yml
name: Bug Report
description: Report a bug
labels:
- "type: bug"
- "status: triage"
body:
- type: input
id: title
attributes:
label: Summary
ESLint flat config exampleâ
import repoPlugin from "eslint-plugin-repo";
export default [
repoPlugin.configs.github,
{
plugins: { "repo-compliance": repoPlugin },
rules: {
"repo-compliance/require-github-issue-template-labels": "warn",
},
},
];
When not to use itâ
Disable this rule if your team intentionally avoids automated labelling (e.g. all labels are applied manually after triage review) or if your issue templates are legacy Markdown forms rather than structured YAML.
Rule catalog ID: R050