You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a declarative labels.yml file and accompanying GitHub Actions workflow to manage repository labels as code, replacing ad-hoc manual label creation and ensuring label consistency across the repository lifecycle.
Acceptance Criteria
New file .github/labels.yml defining all repository labels with name, color, and description
New GitHub Actions workflow that synchronizes labels from labels.yml to the repository
Workflow triggers on push to main when labels.yml changes, plus manual workflow_dispatch
Existing labels not defined in labels.yml are preserved (no destructive sync) unless explicitly configured otherwise
All current repository labels are captured in the initial labels.yml
Documentation in the workflow file or README explains how to add/modify labels
Technical Details
Labels File Format
# .github/labels.yml
- name: featurecolor: "a2eeef"description: "New feature or request"
- name: bugcolor: "d73a4a"description: "Something isn't working"
- name: maintenancecolor: "0075ca"description: "Maintenance and chores"# ... all other labels
Workflow Options
Several community actions support label-as-code workflows:
EndBug/label-sync — Popular, supports additive and destructive sync modes
micnncim/action-label-syncer — Lightweight alternative
Custom script using gh label CLI commands
The workflow should default to additive mode (create and update labels, but do not delete labels missing from the file) to prevent accidental label removal.
Current Labels to Capture
All existing repository labels should be exported to labels.yml as the initial baseline, including the newly created codespaces label (#512).
/task-research topic="declarative GitHub label management with labels.yml"
Research approaches for managing GitHub repository labels as code. Investigate:
1. Popular label sync actions (EndBug/label-sync, crazy-max/ghaction-github-labeler,
github/issue-labeler) and their YAML schema differences
2. The current set of labels on microsoft/hve-core (from the issue body and repo settings)
3. Label YAML schema options: name, color, description, aliases (for renaming)
4. Workflow trigger options: push to main (labels.yml changes), workflow_dispatch, schedule
5. How other Microsoft repos manage labels declaratively
6. Whether the sync action should delete labels not in the YAML file or only add/update
7. Workflow permissions needed (issues: write, or specific label permissions)
Output: Research document at .copilot-tracking/research/{{YYYY-MM-DD}}-label-management-research.md
Phase 2: Plan
Source Material
Research document from Phase 1
Steps
Type /clear to start a fresh context.
Open the research document from Phase 1.
Copy and run this prompt:
/task-plan
Create an implementation plan for declarative label management. The plan should
cover the labels.yml schema, the sync workflow definition, and migration of the
current label set into the YAML file. Include action version pinning with SHA hashes
per repository conventions.
Output: Plan at .copilot-tracking/plans/ and details at .copilot-tracking/details/
Phase 3: Implement
Source Material
Plan from Phase 2
Steps
Type /clear to start a fresh context.
Open the plan document from Phase 2.
Copy and run this prompt:
/task-implement
Implement the declarative label management system. Create .github/labels.yml with
the current label set, create the label-sync workflow, and ensure action versions
are SHA-pinned per repository conventions.
Output: New files created, changes log at .copilot-tracking/changes/
Phase 4: Review
Source Material
Plan from Phase 2
Changes log from Phase 3
Steps
Type /clear to start a fresh context.
Open the plan and changes log.
Copy and run this prompt:
/task-review
Review the label management implementation. Run these validation commands:
- npm run lint:yaml (validate labels.yml and workflow YAML)
Verify that the labels.yml contains all current repository labels, the workflow
uses SHA-pinned action references, and permissions are minimally scoped.
Output: Review log at .copilot-tracking/reviews/
After Review
Pass: All criteria met. Create a PR referencing this issue.
Iterate: Review found issues. Run /clear, return to Phase 3 with the review feedback.
Escalate: Fundamental design issue discovered. Run /clear, return to Phase 1 to research the gap.
Summary
Add a declarative
labels.ymlfile and accompanying GitHub Actions workflow to manage repository labels as code, replacing ad-hoc manual label creation and ensuring label consistency across the repository lifecycle.Acceptance Criteria
.github/labels.ymldefining all repository labels with name, color, and descriptionlabels.ymlto the repositorymainwhenlabels.ymlchanges, plus manualworkflow_dispatchlabels.ymlare preserved (no destructive sync) unless explicitly configured otherwiselabels.ymlTechnical Details
Labels File Format
Workflow Options
Several community actions support label-as-code workflows:
EndBug/label-sync— Popular, supports additive and destructive sync modesmicnncim/action-label-syncer— Lightweight alternativegh labelCLI commandsThe workflow should default to additive mode (create and update labels, but do not delete labels missing from the file) to prevent accidental label removal.
Current Labels to Capture
All existing repository labels should be exported to
labels.ymlas the initial baseline, including the newly createdcodespaceslabel (#512).Dependencies
codespaceslabel created in that issue should be included in the initiallabels.ymlHow to Build This
This is an infrastructure-as-code implementation task using the task-implementor workflow.
Workflow:
/task-research→/task-plan→/task-implement→/task-reviewTip
Between each phase, type
/clearor start a new chat to reset context.Phase 1: Research
Source Material
#file:.github/workflows/main.yml(workflow pattern reference)#file:.github/workflows/pr-validation.yml(workflow pattern reference)#file:.github/instructions/hve-core/workflows.instructions.md(workflow conventions)Steps
/clearto start a fresh context.Output: Research document at
.copilot-tracking/research/{{YYYY-MM-DD}}-label-management-research.mdPhase 2: Plan
Source Material
Steps
/clearto start a fresh context.Output: Plan at
.copilot-tracking/plans/and details at.copilot-tracking/details/Phase 3: Implement
Source Material
Steps
/clearto start a fresh context.Output: New files created, changes log at
.copilot-tracking/changes/Phase 4: Review
Source Material
Steps
/clearto start a fresh context.Output: Review log at
.copilot-tracking/reviews/After Review
/clear, return to Phase 3 with the review feedback./clear, return to Phase 1 to research the gap.Authoring Standards
.github/instructions/hve-core/workflows.instructions.mdSuccess Criteria
.github/labels.ymlcontains all current repository labelsnpm run lint:yamlpasses