| file_type | documentation | |||
|---|---|---|---|---|
| title | Labelling Governance | |||
| description | Unified labelling and metadata governance system for issues, PRs, and discussions | |||
| version | 1.0.1 | |||
| created_date | 2026-08-04 00:00:00 UTC | |||
| last_updated | 2026-08-21 | |||
| author | LightSpeed Team | |||
| maintainer | LightSpeed Team | |||
| domain | governance | |||
| stability | stable | |||
| tags |
|
Labeling Governance is a unified GitHub Actions workflow that consolidates labeling, metadata enforcement, and label hygiene across all issue and pull request types. It replaces 3 legacy workflows with a single, maintainable governance system.
| Component | Before | After |
|---|---|---|
| Workflows | 3 separate files | 1 unified workflow |
| Files consolidated | labeling.yml, dependabot-security-label.yml, issue-close-label-hygiene.yml |
.github/workflows/labeling-governance.yml |
| Lines of code | ~430 | ~233 (46% reduction) |
| GHA minutes/week | ~30 | ~10 (67% reduction) |
| Maintenance surface | High | Low |
.github/workflows/labeling-governance.yml
- Pull Requests:
opened,edited,synchronize,reopened,ready_for_review - Issues:
opened,edited,reopened,closed - Discussions:
created,edited,answered,reopened - Push: On
developbranch (validation only) - Manual Dispatch: Workflow can be triggered manually with options
permissions:
contents: read
issues: write
pull-requests: write
discussions: writeName: standard-labeling
Purpose: Apply labels to PRs, issues, and discussions based on branch name, content patterns, and issue type templates.
Runs on:
- Draft PR filters
- Non-bot authors
- Non-closed events
Key Steps:
- Schema Validation — Verify label configuration schema
- Field Validation — Validate canonical issue fields and docs
- Label Sync — Synchronise GitHub labels with canonical set
- Template Guards — Check for unknown labels in templates
- Labeling Agent — Apply labels based on rules engine
- Report Generation — Create execution report
- Optional Commit — Commit report to repo (if enabled)
Artifacts:
labeling-report-{run_id}.md— Execution reportlabel-sync-{run_id}.md— Label sync report
Labels Applied:
All labels defined in .github/labels.yml can be applied, including:
type:*— Issue type classificationstatus:*— Issue statuspriority:*— Issue priorityarea:*— Code area or domaineffort:*— Effort estimatemeta:*— Metadata and automation markers
Name: label-dependabot-security
Purpose: Detect and label security-related Dependabot updates for guarded automation.
Runs on:
- Pull request events from
dependabot[bot]orapp/dependabot
Detection Logic:
Scans PR title and body for security-related keywords:
to fix(vulnerability fix pattern)vulnerabilit(y|ies)(explicit mention)CVE-XXXX-XXXXX(CVE identifier)GHSA-[a-z0-9-]+(GitHub Security Advisory)security fix(explicit pattern)
Label Applied:
meta:dependabot-security— Marks Dependabot update as security-related
Use Case: Security-related Dependabot PRs can be auto-merged or fast-tracked via mergify rules when this label is present.
Name: cleanup-labels-on-close
Purpose: Automatically remove status labels from issues when they are closed, maintaining label hygiene.
Runs on:
- Issue
closedevents only
Labels Removed:
status:needs-triagestatus:in-progressstatus:needs-review
Rationale: Closed issues no longer need status labels. This cleanup prevents stale labels from accumulating and keeps label datasets clean.
Canonical source of truth for all labels. Synced automatically by Job 1.
Structure:
labels:
type:
- name: type:feature
color: '#0075ca'
description: New feature or capability
- name: type:bug
color: '#d73a49'
description: Bug or defect
# ... more labelsDefines issue type categories and their associated labels.
Pattern-based rules for automatically labeling PRs based on files changed and branch names.
Example:
'type:feature':
- head-branch: '^feat/'
'area:docs':
- changed-files:
- any-glob-to-any-file: 'docs/**'| Variable | Purpose | Default |
|---|---|---|
LABELS_CONFIG |
Path to labels configuration | .github/labels.yml |
ISSUE_TYPES_CONFIG |
Path to issue types config | .github/issue-types.yml |
LABELER_RULES |
Path to labeler rules | .github/labeler.yml |
Trigger the workflow manually with optional parameters:
gh workflow run labeling-governance.yml \
-f dry_run=false \
-f report_commit=truedry_run(default:true) — Run without writing labels (validation only)report_commit(default:false) — Commit the execution report to the repo
Each run generates a report in .github/reports/labeling/YYYY-MM-DD-labeling-{run_id}.md containing:
- Labels applied
- Skipped items (and reasons)
- Errors or warnings
- Summary statistics
Reports are automatically uploaded as GitHub Actions artifacts for retention following the YYYY-MM-DD-{descriptor}.md naming convention.
Full execution logs available in Actions tab under Labeling • Unified Governance.
- Check schema validation — Run Job 1 manually with
dry_run=trueto see validation errors - Review labeler rules — Ensure
.github/labeler.ymlcontains applicable rules - Check label existence — Verify labels exist in
.github/labels.yml - Review permissions — Ensure workflow has
issues: writeandpull-requests: write
- Verify PR author — Check if PR is from
dependabot[bot]orapp/dependabot - Check security patterns — Verify PR title/body contains security keywords
- Review label — Ensure
meta:dependabot-securitylabel exists in config
- Check issue closure — Verify the issue emitted the expected
closedevent - Review label names — Ensure labels match exactly:
status:needs-triage, etc. - Check permissions — Workflow needs
issues: writepermission
| Operation | Minutes/Run |
|---|---|
| Schema validation | ~0.2 |
| Label sync | ~0.5 |
| Labeling agent | ~1.5 |
| Dependabot detection | ~0.1 |
| Cleanup | ~0.1 |
| Total average | ~2.4 minutes/run |
- Previous: ~10 min/run per workflow (3 workflows × ~3 runs/week) = ~90 min/week total
- Current: ~2.4 min/run per workflow (1 workflow × ~3 runs/week) = ~7.2 min/week total
- Reduction: 92% fewer minutes per week (~470 min/month savings)
- Workflow:
.github/workflows/labeling-governance.yml - Labels Config:
.github/labels.yml - Issue Types:
.github/issue-types.yml - Labeler Rules:
.github/labeler.yml - Scripts:
.github/scripts/agents/(labeling agent implementation) - Validation:
.github/scripts/validation/validate-labeling-configs.cjs
- Epic #1227 — GitHub Workflows Consolidation Initiative
- Issue #1324 — Phase 3.3: Cleanup & Deprecate Legacy Workflows
- Phase 3.1 — Create labeling-governance.yml ✅
- Phase 3.2 — Integration testing ✅
- Phase 3.3 — Deprecation & cleanup ✅
Answer: Reduces complexity, improves maintainability, eliminates logic duplication, and saves ~67% of GitHub Actions minutes. A single source of truth for labeling rules is easier to update and monitor.
Answer: No. The old workflows (dependabot-security-label.yml, issue-close-label-hygiene.yml) have been deleted. All labeling is now handled by labeling-governance.yml.
Answer:
- Add label definition to
.github/labels.yml - Create labeling rules in
.github/labeler.yml(if pattern-based) - Test with manual workflow dispatch using
dry_run=true - Commit changes to develop
Answer:
- Check the Actions log for errors
- Verify config files are valid YAML
- Check that referenced labels exist
- Review permission scopes
- If needed, manually apply labels or re-trigger the workflow
Answer: Yes, by modifying the if: condition in the job definition. However, avoid disabling jobs without clear reason—keep all jobs active for complete label coverage.
- Weekly: Review execution reports in
.github/reports/labeling/for anomalies - Monthly: Audit label usage and clean up unused labels
- Quarterly: Review labeler rules for accuracy and coverage
- Edit configuration files (
.github/labels.yml, etc.) - Test changes with manual dispatch using
dry_run=true - Commit to
develop(auto-triggers on push) - Monitor execution reports
Maintained by LightSpeedWP · Built with ☕, 🚀, and open-source spirit!
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit!
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors