custom_properties section configures custom repository properties. Custom properties allow you to add organization-level metadata to repositories, which can be used for categorization, filtering, and reporting.
Overview
Custom properties must first be defined at the organization level before they can be set on repositories. Safe Settings allows you to set values for existing custom properties but does not create new property definitions.Basic Configuration
The name of the custom property. Names are automatically converted to lowercase to avoid comparison issues.
The value to set for the custom property. The value type must match the property definition at the organization level (string, single select, multi select, or true/false).
Complete Examples
Basic Properties
Mixed Property Types
Removing Custom Properties
To remove a custom property value from a repository, Safe Settings sets the value tonull. Properties cannot be deleted from repositories, only unset.
Property Name Normalization
Custom property names are automatically converted to lowercase by Safe Settings. This ensures consistency and avoids comparison issues:Common Use Cases
Team Ownership
Environment Classification
Compliance and Governance
Project Metadata
Organization-Level Property Definitions
Before using custom properties in Safe Settings, they must be defined at the organization level. This is done through the GitHub UI or API:- Go to your organization settings
- Navigate to “Custom properties”
- Create property definitions with:
- Name
- Description
- Type (string, single select, multi select, or true/false)
- Default value (optional)
- Required/optional
Property Types
String Properties
Free-form text values:Single Select Properties
Must match one of the allowed values defined at the org level:Multi Select Properties
Can contain multiple values from the allowed list (format may vary based on org configuration):Boolean Properties
Boolean values represented as strings:Querying Repositories by Custom Properties
Once set, custom properties can be used to filter and search repositories in the GitHub UI and API:Best Practices
- Consistent Naming: Use lowercase, hyphen-separated names for properties
- Define First: Always define properties at the org level before setting them in repos
- Document Values: Document allowed values for select properties in your organization
- Use Sparingly: Only create properties that will be consistently used across repositories
- Standardize Values: Establish conventions for property values (e.g., team names, tier levels)
Limitations
- Custom properties must be defined at the organization level before use
- Property names are limited to lowercase alphanumeric characters and hyphens
- Property values cannot be deleted, only set to
null - The number of custom properties per organization may be limited by GitHub