This document describes the automatic labeling system for the riksdagsmonitor repository. Labels are automatically applied to pull requests based on file changes, PR titles, and PR body content.
Last Updated: 2026-02-15
Maintained by: Hack23 AB
The riksdagsmonitor repository uses an automated labeling system powered by GitHub Actions to categorize pull requests and issues. This helps maintain organization, improves searchability, and provides quick visual context about changes.
- ✅ Automatic labeling based on file paths, PR titles, and descriptions
- ✅ 46 labels covering all aspects of the project
- ✅ Size labels automatically calculated from PR diff
- ✅ Security hardened workflows with SHA pinning
- ✅ Status tracking with priority and progress labels
Run the label setup workflow to create all required labels:
- Go to Actions → Setup Repository Labels
- Click Run workflow
- (Optional) Check "Recreate all labels" to delete existing labels first
- Wait for completion (usually < 1 minute)
Direct link: Setup Repository Labels Workflow
Once labels are created, the automatic labeler runs on every PR:
- Triggers on PR opened, synchronize, reopened, edited
- Applies labels based on
.github/labeler.ymlconfiguration - Adds size labels based on diff statistics
- Posts a summary comment on new PRs
Labels for content generation and feature development:
Auto-applies when:
- Changing files in
news/,dashboard/,js/*-dashboard.js - PR title starts with
news:,dashboard:,viz: - PR body contains
- [x] 📰 News Content,- [x] 📊 Dashboard
Labels for technical implementation:
| Label | Color | Description |
|---|---|---|
html-css |
HTML/CSS changes | |
javascript |
JavaScript code changes | |
workflow |
GitHub Actions workflows | |
security |
Security improvements |
Auto-applies when:
- Changing
.html,.css,.jsfiles - Modifying
.github/workflows/files - Updating security documentation
- PR title starts with
html:,js:,workflow:,security:
Labels for data pipeline and integration:
| Label | Color | Description |
|---|---|---|
cia-data |
CIA platform data integration | |
riksdag-data |
Riksdag-Regering MCP data | |
data-pipeline |
ETL and data processing | |
schema |
Data schema changes |
Auto-applies when:
- Changing files in
cia-data/,data/cia/,schemas/ - Modifying
scripts/load-cia-*.js,scripts/mcp-client.js - PR title starts with
cia:,riksdag:,pipeline:,schema:
Labels for multi-language support (14 languages):
| Label | Color | Description |
|---|---|---|
i18n |
Internationalization/localization | |
translation |
Translation updates | |
rtl |
RTL language support (Arabic, Hebrew) |
Auto-applies when:
- Changing
index_*.html,sitemap_*.html,news/**/*-*.html - Modifying
TRANSLATION_GUIDE.md - PR title starts with
i18n:,translation:,rtl:
Supported Languages:
- English (EN), Swedish (SV), Danish (DA), Norwegian (NO), Finnish (FI)
- German (DE), French (FR), Spanish (ES), Dutch (NL)
- Arabic (AR), Hebrew (HE), Japanese (JA), Korean (KO), Chinese (ZH)
Labels for security and compliance frameworks:
| Label | Color | Description |
|---|---|---|
isms |
ISMS compliance changes | |
iso-27001 |
ISO 27001 controls | |
nist-csf |
NIST CSF compliance | |
cis-controls |
CIS Controls |
Auto-applies when:
- Changing
SECURITY_ARCHITECTURE.md,THREAT_MODEL.md,CRA-ASSESSMENT.md - Modifying
.github/skills/iso-27001-controls/,.github/skills/nist-csf-mapping/ - PR title starts with
isms:,iso-27001:,nist:,cis:
Frameworks:
- ISO 27001:2022 - Information security management
- NIST CSF 2.0 - Cybersecurity framework
- CIS Controls v8.1 - Security best practices
Labels for CI/CD and infrastructure:
| Label | Color | Description |
|---|---|---|
ci-cd |
CI/CD pipeline changes | |
deployment |
Deployment configuration | |
performance |
Performance optimization | |
monitoring |
Monitoring and alerting |
Auto-applies when:
- Changing
.github/workflows/files - Modifying
CNAME,robots.txt,vite.config.js - PR title starts with
ci:,deploy:,perf:,monitoring:
Labels for code quality and testing:
| Label | Color | Description |
|---|---|---|
testing |
Test coverage | |
accessibility |
WCAG 2.1 AA compliance | |
documentation |
Documentation updates | |
refactor |
Code refactoring |
Auto-applies when:
- Changing files in
tests/,cypress/,*.test.js - Modifying
**/*.mdfiles - PR title starts with
test:,a11y:,docs:,refactor:
Essential workflow labels:
| Label | Color | Description |
|---|---|---|
bug |
Bug fixes | |
enhancement |
Enhancements | |
dependencies |
Dependency updates |
Auto-applies when:
- PR title starts with
fix:,bug:,feat:,deps: - Changing
package.json,package-lock.json - PR body contains
- [x] 🐛 Bug Fix,- [x] ✨ Enhancement
Labels for GitHub Copilot agents and agentic workflows:
| Label | Color | Description |
|---|---|---|
agent |
Agent configuration | |
skill |
Skill configuration | |
agentic-workflow |
Agentic workflow changes |
Auto-applies when:
- Changing
.github/agents/,.github/skills/,AGENTS.md,SKILLS.md - Modifying
.github/workflows/*.md,.github/workflows/*.lock.yml - PR title starts with
agent:,skill:,aw:
Manual labels for prioritization:
Usage: Manually add to PRs/issues to indicate urgency.
Automatically calculated from PR diff:
| Label | Color | Lines Changed | Description |
|---|---|---|---|
size-xs |
< 10 | Extra small change | |
size-s |
10-50 | Small change | |
size-m |
50-250 | Medium change | |
size-l |
250-1000 | Large change | |
size-xl |
> 1000 | Extra large change |
Auto-applies: Calculated from additions + deletions in PR diff.
Manual labels for workflow tracking:
| Label | Color | Description |
|---|---|---|
status-needs-review |
Needs code review | |
status-in-progress |
Work in progress | |
status-blocked |
Blocked by dependencies | |
status-ready |
Ready to merge |
Usage: Manually add/update as PR progresses through workflow.
The automatic labeler is configured in .github/labeler.yml. Labels are applied based on:
- File path patterns - Uses glob patterns to match changed files
- PR title - Matches title prefixes (e.g.,
fix:,feat:) - PR body - Matches checkbox patterns (e.g.,
- [x] 🐛 Bug Fix)
Example:
news:
- any:
- changed-files:
- any-glob-to-any-file:
- "news/**/*.html"
- "scripts/article-template.js"
- title: "news:*"
- body: "- [x] 📰 News Content"To modify the labeling system:
- Edit label definitions: Modify
.github/workflows/setup-labels.yml - Edit auto-labeling rules: Modify
.github/labeler.yml - Run setup workflow: Actions → Setup Repository Labels
- Test on new PR: Create a test PR to verify labels
Files changed:
news/2026-02-15-riksdag-budget-vote-en.htmlnews/2026-02-15-riksdag-budget-vote-sv.html
Labels applied:
- ✅
news(news article) - ✅
html-css(HTML files) - ✅
i18n(multi-language) - ✅
translation(Swedish translation) - ✅
size-s(< 50 lines)
Files changed:
js/politician-dashboard.jspolitician-dashboard.htmlcia-data/politician/view_riksdagen_politician_ranking_sample.csv
PR Title: feat: Add politician influence network visualization
Labels applied:
- ✅
dashboard(dashboard changes) - ✅
visualization(data visualization) - ✅
javascript(JS code) - ✅
html-css(HTML file) - ✅
cia-data(CIA data) - ✅
enhancement(feature) - ✅
size-m(50-250 lines)
Files changed:
SECURITY_ARCHITECTURE.mdTHREAT_MODEL.md.github/skills/iso-27001-controls/SKILL.md
PR Title: security: Update ISO 27001 control mapping
Labels applied:
- ✅
security(security changes) - ✅
isms(ISMS compliance) - ✅
iso-27001(ISO 27001) - ✅
documentation(markdown files) - ✅
skill(skill changes) - ✅
size-m(50-250 lines)
Files changed:
.github/workflows/data-pipeline.yml.github/workflows/quality-checks.yml
PR Title: ci: Optimize data pipeline workflow
Labels applied:
- ✅
workflow(GitHub Actions) - ✅
ci-cd(CI/CD changes) - ✅
data-pipeline(data pipeline) - ✅
performance(optimization) - ✅
size-s(< 50 lines)
Problem: Labels are not being applied to PRs.
Solutions:
- Check if labels exist: Actions → Setup Repository Labels → Run workflow
- Verify labeler workflow ran: Actions → Pull Request Automatic Labeler
- Check workflow logs for errors
- Ensure
.github/labeler.ymlis valid YAML
Problem: Some labels don't exist in the repository.
Solution:
- Go to Actions → Setup Repository Labels
- Click "Run workflow"
- (Optional) Check "Recreate all labels" to rebuild from scratch
- Wait for completion
- Re-trigger labeler on existing PRs
Problem: Size label doesn't match PR diff.
Explanation: Size is calculated from total changes (additions + deletions), not just additions.
Formula:
TOTAL_CHANGES = ADDITIONS + DELETIONS
if TOTAL_CHANGES < 10: size-xs
elif TOTAL_CHANGES < 50: size-s
elif TOTAL_CHANGES < 250: size-m
elif TOTAL_CHANGES < 1000: size-l
else: size-xl- Labeler Configuration:
.github/labeler.yml - Setup Workflow:
.github/workflows/setup-labels.yml - Labeler Workflow:
.github/workflows/labeler.yml - GitHub Labeler Action: actions/labeler
- ISMS Documentation: Hack23 ISMS-PUBLIC
When contributing to the labeling system:
- ✅ Test label changes on a test PR first
- ✅ Document new labels in this file
- ✅ Follow existing color scheme patterns
- ✅ Ensure labels align with repository structure
- ✅ Update WORKFLOWS.md if adding new workflows
Last Updated: 2026-02-15
Version: 1.0
Maintained by: Hack23 AB (Org.nr 5595347807)