labels section configures labels for issues and pull requests. Labels help categorize and organize work in repositories.
Basic Configuration
Labels can be configured in two ways:Array Format
Object Format with Include/Exclude
Label Properties
The name of the label.
The color of the label in hexadecimal format. The
# prefix is optional. Color values can be:- Hexadecimal without
#:CC0000 - Hexadecimal with
#(must be quoted):"#336699"
A short description of the label.
Renaming Labels
Include the old name to rename an existing label. This preserves the label’s history and associations with issues and pull requests.
Include/Exclude Patterns
Include
When using the object format, specify labels to be managed by Safe Settings.
Exclude
Regular expression patterns for labels that should not be deleted when not in the configuration. This allows manual label creation in GitHub while still managing a core set of labels.
Regular expression pattern to match label names.
Complete Examples
Basic Labels (Array Format)
Labels with Renaming
Labels with Include/Exclude
How Exclude Patterns Work
Exclude patterns use regular expressions to match label names. When Safe Settings syncs labels:- It creates or updates labels defined in
include(or the array) - It identifies labels that exist in GitHub but aren’t in the configuration
- It checks if any excluded pattern matches those labels
- Labels matching exclude patterns are not deleted
- Labels not matching any exclude pattern are deleted