Skip to content

fix: align issue template labels and validate them in label sync#212

Merged
EMaher merged 1 commit into
mainfrom
emaher-issue-label-validation
Jul 2, 2026
Merged

fix: align issue template labels and validate them in label sync#212
EMaher merged 1 commit into
mainfrom
emaher-issue-label-validation

Conversation

@EMaher

@EMaher EMaher commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Why

The issue form templates were drifting from the label set that issue-labels-sync.yml defines and syncs. question.yml used question and bug-report.yml used bug, but the defined labels use the type: prefix (type:question, type:bug). Nothing caught this drift, so a template could apply a label that does not exist in the repo.

What changed

Template label fixes

  • question.yml: question -> type:question
  • bug-report.yml: bug -> type:bug

Guardrail in the label-sync workflow

  • Added a validation step to issue-labels-sync.yml that scans every file in .github/ISSUE_TEMPLATE/ and calls core.setFailed if a template references a label the workflow does not define. This fails the run instead of silently letting drift back in.
  • Templates are parsed with js-yaml (already a project dependency) rather than a hand-rolled parser, so both YAML-sequence and comma-delimited labels: forms are handled correctly.
  • To make require('js-yaml') resolvable inside the actions/github-script step, the job now installs prod deps with npm ci --omit=dev --ignore-scripts on Node 24. --omit=dev keeps the install lean; --ignore-scripts is supply-chain hardening given the token-authenticated, issues: write context.
  • The workflow now also triggers on edits to .github/ISSUE_TEMPLATE/** and to the workflow file itself, and the validation runs even when no squad roster file is present (previously an early return could skip it).

Squad GitHubExpert standing rules

  • Recorded two standing rules in .squad/agents/githubexpert/charter.md: always pin Node 24 in workflows, and always run gh aw compile when authoring agentic workflows.

Notes for reviewers

  • No js-yaml version bump is needed; it is an existing prod dependency and the lockfile already covers it. Verified locally that npm ci --omit=dev --ignore-scripts installs cleanly and require('js-yaml') resolves from the workspace root (how github-script resolves bare module IDs).
  • All three real templates validate clean against the current defined-label set.
  • The .squad/decisions/inbox/* staging files for these rules are intentionally gitignored and are not part of this PR; the charter edits are the tracked, durable change.

Issue form templates referenced labels that were not part of the label
set defined and synced by issue-labels-sync.yml, so templates could apply
labels that do not exist.

- Update question.yml (question -> type:question) and bug-report.yml
  (bug -> type:bug) to use the defined type: labels.
- Add a validation step to issue-labels-sync.yml that fails the run if any
  issue template references a label the workflow does not define. Templates
  are parsed with js-yaml (a project dependency) rather than by hand.
- Install prod deps via `npm ci --omit=dev --ignore-scripts` on Node 24 so
  the github-script step can require('js-yaml'); trigger the workflow on
  ISSUE_TEMPLATE and workflow edits; run validation even when no squad
  roster file exists.
- Record GitHubExpert standing rules in its charter: pin Node 24 in all
  workflows, and always run `gh aw compile` when authoring agentic workflows.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@EMaher EMaher requested a review from Copilot July 1, 2026 21:17
@EMaher EMaher self-assigned this Jul 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR prevents GitHub issue templates from drifting away from the repository’s authoritative label definitions by (1) aligning template labels with the type:* naming scheme and (2) adding a workflow-time validation that fails if any issue template references an undefined label.

Changes:

  • Updated issue form templates to use type:question / type:bug instead of question / bug.
  • Enhanced .github/workflows/issue-labels-sync.yml to install prod deps and validate .github/ISSUE_TEMPLATE/*.yml|*.yaml labels against the workflow-defined label set, failing the run on mismatch.
  • Documented standing rules for Node 24 workflow pinning and compiling agentic workflows via gh aw compile in the GitHubExpert charter.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
.squad/agents/githubexpert/charter.md Adds standing rules for Node 24 pinning and gh aw compile to keep workflow authoring consistent and enforceable.
.github/workflows/issue-labels-sync.yml Adds Node setup + prod dependency install and validates issue template labels against the workflow-defined label set.
.github/ISSUE_TEMPLATE/question.yml Aligns template label to type:question.
.github/ISSUE_TEMPLATE/bug-report.yml Aligns template label to type:bug.

@EMaher EMaher merged commit ee26bd6 into main Jul 2, 2026
7 checks passed
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.

3 participants