Automatic Labeling System
February 15, 2026 ยท View on GitHub
Overview
This repository uses an automatic labeling system to apply labels to pull requests based on the files changed, PR title, and PR body content. This helps organize and categorize PRs efficiently.
Components
1. Labeler Configuration (.github/labeler.yml)
Defines rules for automatically applying labels based on:
- File paths: Labels are applied when specific files or patterns are changed
- PR title: Labels are applied based on conventional commit prefixes (e.g.,
feat:,fix:,docs:) - PR body: Labels are applied based on checkboxes in PR descriptions
- Change size: Automatic size labels based on number of files changed
2. Setup Labels Workflow (.github/workflows/setup-labels.yml)
A manual workflow that creates and updates all repository labels with:
- Consistent colors
- Clear descriptions
- Option to recreate all labels from scratch
To run this workflow:
- Go to Actions โ Setup Repository Labels
- Click Run workflow
- Choose whether to recreate all labels (optional)
- Wait for completion
3. Labeler Workflow (.github/workflows/labeler.yml)
An automatic workflow that runs on every pull request to apply labels based on the configuration in labeler.yml.
Triggers:
- When a PR is opened
- When a PR is synchronized (new commits)
- When a PR is reopened
- When a PR is edited
Label Categories
๐ Features and Enhancements
feature- New feature or requestenhancement- Enhancement to existing functionality
๐ Bug Fixes
bug- Something isn't working
๐จ UI/UX
ui- User interface improvementsdesign- Design and styling updates
๐ Internationalization
i18n- Internationalization and localization (automatically applied when translation files are changed)
๐๏ธ Infrastructure & DevOps
infrastructure- CI/CD and infrastructuredeployment- Deployment-related changesperformance- Performance improvementsconfig- Configuration changes
๐ Code Quality
refactor- Code refactoringquality-checks- Quality checks and validation
๐ Security & Compliance
security- Security improvementscompliance- Compliance and ISMS-relatedaccessibility- Accessibility improvements
๐ Documentation
documentation- Documentation updates
๐ฆ Dependencies
dependencies- Dependency updates
๐ค GitHub Copilot & AI
copilot- GitHub Copilot configurationagents- GitHub Copilot agentsskills- GitHub Copilot skills
๐ Content Types
content-pages- Main website pagescontent-blog- Blog contentcontent-projects- Project showcase pagescontent-isms- ISMS policy pagescontent-services- Services and industries
๐ผ๏ธ Assets
assets- Images, icons, and media files
๐ฏ SEO & Analytics
seo- SEO and sitemap changes
๐ Specific Areas
area-homepage- Homepage changesarea-cia- Citizen Intelligence Agencyarea-blacktrigram- Black Trigram gamearea-compliance- Compliance Manager
๐ Size Labels
size-xs- Extra small change (1-10 files)size-s- Small change (11-30 files)size-m- Medium change (31-100 files)size-l- Large change (101-500 files)size-xl- Extra large change (500+ files)
Priority Labels
priority-high- High prioritypriority-medium- Medium prioritypriority-low- Low priority
Workflow Labels
good first issue- Good for newcomershelp wanted- Extra attention is neededwontfix- This will not be worked onduplicate- This issue or pull request already existsinvalid- This doesn't seem rightquestion- Further information is requested
Usage
For PR Authors
Automatic Labeling
Labels are automatically applied based on the files you change. For example:
- Changing
*.htmlfiles โcontent-pageslabel - Changing files with
_sv.html,_de.html, etc. โi18nlabel - Changing
.github/workflows/*โinfrastructurelabel - Changing
SECURITY.mdโsecuritylabel
Manual Labeling via PR Title
Use conventional commit prefixes in your PR title:
feat:orfeature:โfeaturelabelfix:orbug:โbuglabeldocs:ordoc:โdocumentationlabelperf:oroptimize:โperformancelabelrefactor:โrefactorlabelsecurity:โsecuritylabel
Manual Labeling via PR Body
Add checkboxes to your PR description:
- [x] ๐ New Feature/Enhancementโfeaturelabel- [x] ๐ Bug Fixโbuglabel- [x] ๐จ UI/UX Improvementsโuilabel- [x] ๐๏ธ Infrastructure & DevOpsโinfrastructurelabel- [x] ๐ Security & Complianceโsecuritylabel- [x] ๐ Documentationโdocumentationlabel- [x] ๐ฆ Dependencies Updateโdependencieslabel
For Repository Maintainers
Initial Setup
- Run the Setup Repository Labels workflow to create all labels
- The Labeler workflow will automatically start working on new PRs
Updating Label Configuration
- Edit
.github/labeler.ymlto add or modify labeling rules - Commit and push changes
- New rules will apply to subsequent PRs
Updating Label Definitions
- Edit
.github/workflows/setup-labels.ymlto modify label colors or descriptions - Commit and push changes
- Run the Setup Repository Labels workflow to apply updates
Examples
Example 1: Translating a page to Swedish
Files changed:
services_sv.html
Labels automatically applied:
i18n(internationalization)content-services(services content)size-xs(1 file changed)
Example 2: Adding a new blog post in all languages
Files changed:
blog-new-post.htmlblog-new-post_sv.htmlblog-new-post_de.htmlblog-new-post_es.html- ... (13+ language variants)
Labels automatically applied:
content-blog(blog content)i18n(internationalization)size-sorsize-m(depending on file count)
Example 3: Updating CI/CD pipeline
Files changed:
.github/workflows/main.yml
PR title:
ci: Optimize deployment to S3
Labels automatically applied:
infrastructure(workflow file changed)deployment(main.yml changed)size-xs(1 file changed)
Example 4: Security fix
Files changed:
SECURITY.mdSECURITY_ARCHITECTURE.md.github/workflows/scorecards.yml
PR title:
security: Update security documentation and workflow
Labels automatically applied:
security(security files changed + title prefix)documentation(markdown files changed)infrastructure(workflow changed)size-xs(3 files changed)
Troubleshooting
Labels not being applied?
- Check that the Setup Repository Labels workflow has been run at least once
- Verify that the
.github/labeler.ymlfile exists in the default branch - Check the Labeler workflow logs in the Actions tab
- Confirm the labeler workflow run completed successfully for the PR (including fork PRs); the workflow uses
pull_request_target, so it can label forks as long as it does not check out or execute untrusted PR code
Need to add a new label?
- Add the label definition to
.github/workflows/setup-labels.yml - Add the labeling rule to
.github/labeler.yml - Run the Setup Repository Labels workflow
- New PRs will use the updated configuration
Labels applied incorrectly?
- Review the rules in
.github/labeler.yml - Adjust file patterns or conditions as needed
- Manually remove incorrect labels from the PR
- Update the configuration for future PRs
Best Practices
- Use conventional commit prefixes in PR titles for consistent labeling
- Include checkboxes in PR descriptions to trigger specific labels
- Run Setup Labels workflow after adding new label types
- Review automatically applied labels and adjust manually if needed
- Keep labeler.yml updated as the repository structure evolves
- Document new label categories when adding significant new labels
Security Considerations
The labeler workflow uses pull_request_target trigger which:
- Runs in the context of the base repository (not the fork)
- Has write access to apply labels
- Is hardened with step-security/harden-runner for audit logging
- Uses minimal permissions: contents:read, pull-requests:write, issues:write
- Does not check out or execute untrusted PR code
This ensures safe operation even when processing PRs from untrusted forks, as long as the workflow does not check out or run code from the PR.
Maintenance
Regular Tasks
- Quarterly: Review label usage and consolidate unused labels
- When needed: Update
.github/labeler.ymlfor new file patterns - When needed: Update
.github/workflows/setup-labels.ymlfor new label types
Monitoring
- Check the Actions tab for workflow failures
- Review PRs to ensure labels are applied correctly
- Gather feedback from contributors about labeling accuracy
References
Last Updated: 2026-02-15
Maintained By: Hack23 DevOps Team