A lightweight GitHub Action that automatically creates, updates, and manages repository labels from a YAML configuration file.
Keeps labels consistent and synchronized across repositories.
- Automated Label Management – Create, update, and delete labels automatically
- Color Normalization – Handles hex color codes with or without
# - Detailed Outputs – Provides counts for created, updated, deleted, and ignored labels
- Enterprise Support – Works with GitHub Enterprise Server
- Ignore Flag – Skip specific labels during sync
- Multiple Sources – Load config from local files, URLs, or other repositories
- Optional Deletion – Control whether missing labels are removed
- YAML Configuration – Define labels in a simple, human-readable format
name: Synchronize Labels
on:
push:
branches: [main]
paths:
- '.github/config/repository-labels.yml'
jobs:
synchronize-labels:
permissions:
contents: read
issues: write
runs-on: ubuntu-latest
steps:
- name: Synchronize repository labels
uses: lukas-kuntze/devx-action-label-manager@main
with:
config_file: .github/config/repository-labels.yml
github_token: ${{ secrets.GITHUB_TOKEN }}| Input | Description | Required | Default |
|---|---|---|---|
config_file |
Path, URL, or GitHub repo path to YAML configuration file | ❌ No | .github/config/repository-labels.yml |
delete_missing |
Delete labels not in config | ❌ No | false |
github_api_url |
GitHub API base URL (Enterprise) | ❌ No | https://api.github.com |
github_token |
GitHub token for authentication | ✅ Yes | ${{ github.token }} |
| Output | Description |
|---|---|
labels_created |
Number of labels created |
labels_updated |
Number of labels updated |
labels_deleted |
Number of labels deleted |
labels_ignored |
Number of labels ignored |
Create .github/config/repository-labels.yml:
labels:
- name: docs
description: This label marks tasks to update, improve, or extend project documentation.
color: E4DA8A
- name: feature
description: This label marks tasks for developing or adding new functionality to the project.
color: 154C79
- name: fix
description: This label marks tasks that fix issues or bugs in the code.
color: BC0003Field Descriptions:
name– Label name (required)color– Hex color code with or without#(required)description– Short description (optional, ≤100 chars)ignore– Skip this label iftrue(optional)
with:
config_file: .github/config/repository-labels.ymlwith:
config_file: https://raw.githubusercontent.com/org/repo/main/repository-labels.ymlwith:
config_file: organization/shared-configs/repository-labels.ymllabels:
- name: chore
description: This label marks routine tasks, maintenance, or non-functional changes.
color: 83D09B
- name: docs
description: This label marks tasks to update, improve, or extend project documentation.
color: E4DA8A
- name: feat
description: This label marks tasks for developing or adding new functionality to the project.
color: 154C79
- name: fix
description: This label marks tasks that fix issues or bugs in the code.
color: BC0003labels:
- name: large
description: Marks large pull requests (≤ 2000 lines changed).
color: F66A0A
- name: medium
description: Marks medium-sized pull requests (≤ 500 lines changed).
color: F5C518
- name: oh lawd he comin
description: Marks oversized pull requests (> 2000 lines changed). Such PRs should be split if possible.
color: D73A4A
- name: small
description: Marks small pull requests (≤ 100 lines changed).
color: 36B37E
- name: teeny
description: Marks very small pull requests (≤ 10 lines changed).
color: B7EB8Flabels:
- name: blocked
description: This label marks tasks that are blocked by dependencies, missing resources, or issues.
color: FF0004
ignore: true
- name: needs clarification
description: This label marks tasks that need more information or further discussion.
color: 1F6DAD- name: Synchronize Labels
uses: lukas-kuntze/devx-action-label-manager@main
with:
config_file: .github/config/repository-labels.yml
github_api_url: 'https://github.company.com/api/v3'
github_token: ${{ secrets.GITHUB_TOKEN }}- Load Configuration – Loads the YAML file via GitHub API, URL, or from another repository
- Validate – Ensures valid names, colors, and uniqueness
- Fetch Existing Labels – Retrieves all current repository labels
- Sync Labels – Creates, updates, deletes, or skips based on settings
- Report Results – Outputs statistics for created, updated, deleted, and ignored labels
contents: readpermission for the workflow (to read configuration files)issues: writepermission for the workflow (to manage labels)- No checkout required – configuration is loaded via GitHub API
Created and maintained by Lukas Kuntze
Software Developer · Software Development & IT Services Kuntze
GitHub: lukas-kuntze
Designed for internal automation and engineering workflows.
Public use is possible but not officially supported.