Automation and governance workflows need to define and manage custom property schemas at the enterprise level. Enterprise-level custom properties cascade to all organizations within the enterprise, providing a unified metadata layer for repository classification, compliance tagging, and policy enforcement across the entire enterprise.
Request
Desired capability
Full lifecycle management of enterprise-level custom property definitions: create, read, update, delete, and promote from organization. All five value types (string, single_select, multi_select, true_false, url) should be supported. Enterprise admins should be able to define properties centrally and have them apply across all orgs.
Acceptance criteria
- All enterprise custom property definition endpoints are implemented
- All five value types are supported:
string, single_select, multi_select, true_false, url
- Properties can be created with all supported options:
required, default_value, description, allowed_values, values_editable_by, require_explicit_values
- Organization-level properties can be promoted to enterprise level
- Tests create definitions, verify retrieval, update, and clean up — full lifecycle
- Tests cover all five value types
Technical decisions
API choice: REST API. The enterprise custom properties endpoints provide full CRUD coverage. No GraphQL fallback needed.
Endpoints to implement:
| Method |
Endpoint |
Function |
GET |
/enterprises/{enterprise}/properties/schema |
Get-GitHubEnterpriseCustomProperty (list all) |
GET |
/enterprises/{enterprise}/properties/schema/{custom_property_name} |
Get-GitHubEnterpriseCustomProperty -Name (get one) |
PUT |
/enterprises/{enterprise}/properties/schema/{custom_property_name} |
Set-GitHubEnterpriseCustomProperty (create/update single) |
PATCH |
/enterprises/{enterprise}/properties/schema |
Set-GitHubEnterpriseCustomProperty (batch create/update) |
DELETE |
/enterprises/{enterprise}/properties/schema/{custom_property_name} |
Remove-GitHubEnterpriseCustomProperty |
PUT |
/enterprises/{enterprise}/properties/schema/organizations/{org}/{custom_property_name}/promote |
Move-GitHubOrganizationCustomPropertyToEnterprise |
Permissions required:
- Read:
"Custom properties" enterprise permissions (read)
- Write/Delete:
"Custom properties" enterprise permissions (write)
Function placement:
- Public:
src/functions/public/Enterprise/CustomProperties/
- Private:
src/functions/private/Enterprise/ (if needed)
Value types supported:
| Type |
Description |
allowed_values |
default_value |
string |
Free-text |
N/A |
string or null |
single_select |
Pick one |
Required array |
string or null |
multi_select |
Pick multiple |
Required array |
array or null |
true_false |
Boolean |
N/A |
"true" / "false" or null |
url |
URL |
N/A |
string or null |
Property definition schema:
{
"property_name": "environment",
"value_type": "single_select",
"required": true,
"default_value": "production",
"description": "Prod or dev environment",
"allowed_values": ["production", "development"],
"values_editable_by": "org_actors",
"require_explicit_values": true
}
Class: Reuse or extend GitHubCustomPropertyDefinition class (to be created) with properties: Name, ValueType, Required, DefaultValue, Description, AllowedValues, ValuesEditableBy, RequireExplicitValues, SourceType, Url.
Test approach: Integration tests in tests/Enterprise.Tests.ps1. Tests must:
- Create property definitions of each type during setup
- Retrieve and validate the definitions
- Update a property definition
- Promote an org property to enterprise (if org custom properties issue is done first)
- Remove all test properties during cleanup
Implementation plan
Classes
Public functions
Tests
Automation and governance workflows need to define and manage custom property schemas at the enterprise level. Enterprise-level custom properties cascade to all organizations within the enterprise, providing a unified metadata layer for repository classification, compliance tagging, and policy enforcement across the entire enterprise.
Request
Desired capability
Full lifecycle management of enterprise-level custom property definitions: create, read, update, delete, and promote from organization. All five value types (
string,single_select,multi_select,true_false,url) should be supported. Enterprise admins should be able to define properties centrally and have them apply across all orgs.Acceptance criteria
string,single_select,multi_select,true_false,urlrequired,default_value,description,allowed_values,values_editable_by,require_explicit_valuesTechnical decisions
API choice: REST API. The enterprise custom properties endpoints provide full CRUD coverage. No GraphQL fallback needed.
Endpoints to implement:
GET/enterprises/{enterprise}/properties/schemaGet-GitHubEnterpriseCustomProperty(list all)GET/enterprises/{enterprise}/properties/schema/{custom_property_name}Get-GitHubEnterpriseCustomProperty -Name(get one)PUT/enterprises/{enterprise}/properties/schema/{custom_property_name}Set-GitHubEnterpriseCustomProperty(create/update single)PATCH/enterprises/{enterprise}/properties/schemaSet-GitHubEnterpriseCustomProperty(batch create/update)DELETE/enterprises/{enterprise}/properties/schema/{custom_property_name}Remove-GitHubEnterpriseCustomPropertyPUT/enterprises/{enterprise}/properties/schema/organizations/{org}/{custom_property_name}/promoteMove-GitHubOrganizationCustomPropertyToEnterprisePermissions required:
"Custom properties" enterprise permissions (read)"Custom properties" enterprise permissions (write)Function placement:
src/functions/public/Enterprise/CustomProperties/src/functions/private/Enterprise/(if needed)Value types supported:
allowed_valuesdefault_valuestringsingle_selectmulti_selecttrue_false"true"/"false"or nullurlProperty definition schema:
{ "property_name": "environment", "value_type": "single_select", "required": true, "default_value": "production", "description": "Prod or dev environment", "allowed_values": ["production", "development"], "values_editable_by": "org_actors", "require_explicit_values": true }Class: Reuse or extend
GitHubCustomPropertyDefinitionclass (to be created) with properties:Name,ValueType,Required,DefaultValue,Description,AllowedValues,ValuesEditableBy,RequireExplicitValues,SourceType,Url.Test approach: Integration tests in
tests/Enterprise.Tests.ps1. Tests must:Implementation plan
Classes
GitHubCustomPropertyDefinitionclass insrc/classes/public/CustomProperties/Public functions
Get-GitHubEnterpriseCustomProperty— list all or get by name (src/functions/public/Enterprise/CustomProperties/)Set-GitHubEnterpriseCustomProperty— create or update single or batch (src/functions/public/Enterprise/CustomProperties/)Remove-GitHubEnterpriseCustomProperty— delete by name (src/functions/public/Enterprise/CustomProperties/)Move-GitHubOrganizationCustomPropertyToEnterprise— promote org property (src/functions/public/Enterprise/CustomProperties/)Tests
tests/Enterprise.Tests.ps1stringtype: create, get, update, deletesingle_selecttype: create with allowed values, verify constraintsmulti_selecttype: create with allowed values, verify array handlingtrue_falsetype: create, verify boolean handlingurltype: create, verify URL handling