Skip to content

Add commands for managing organization custom property definitions #565

@MariusStorhaug

Description

Context

GitHub organizations can define custom properties as a schema for repository metadata. These property definitions control what custom properties are available, their data types, allowed values, default values, and whether they are required. This is separate from the property values set on individual repositories.

Custom property definitions are used to enforce organizational standards — for example, requiring every repository to declare an Environment (production / development) or a Team owner. Automation and governance workflows depend on these definitions being manageable programmatically.

Request

The GitHub PowerShell module currently has no commands for managing organization-level custom property definitions. The only existing command is Get-GitHubRepositoryCustomProperty, which reads property values from a single repository — not the property schema from the organization.

Desired capability

Organization administrators should be able to create, read, update, and remove custom property definitions for their organization using PowerShell commands. This includes specifying the property name, value type, description, allowed values, default values, required status, and editability settings.

Platform data types

The GitHub platform supports five custom property value types:

Value type API value_type Description
string string Free-form text
single_select single_select Single selection from an ordered list of allowed values
multi_select multi_select Multiple selections from an ordered list of allowed values
true_false true_false Boolean — "true" or "false"
url url A URL string

Property definition schema

Each custom property definition includes:

Field Type Description
property_name string Name of the property. Characters: a-z, A-Z, 0-9, _, -, $, #. No spaces. Max 75 characters.
value_type string One of: string, single_select, multi_select, true_false, url
required boolean Whether the property is required on all repositories
default_value string, array, or null Default value applied to repositories without an explicit value
description string or null Short description of the property
allowed_values string[] or null Ordered list of allowed values (for single_select and multi_select). Max 200 values.
values_editable_by string or null Who can edit values: org_actors, org_and_repo_actors, or null
require_explicit_values boolean Whether repositories must have an explicitly set value (no inheriting default)

REST API endpoints

The following REST API endpoints are involved:

Method Endpoint Description
GET /orgs/{org}/properties/schema Get all custom properties for an organization
GET /orgs/{org}/properties/schema/{custom_property_name} Get a custom property for an organization
PUT /orgs/{org}/properties/schema/{custom_property_name} Create or update a custom property for an organization
PATCH /orgs/{org}/properties/schema Create or update custom properties for an organization (batch)
DELETE /orgs/{org}/properties/schema/{custom_property_name} Remove a custom property for an organization

Additionally, the following endpoints manage property values on repositories at the organization level:

Method Endpoint Description
GET /orgs/{org}/properties/values List custom property values for organization repositories
PATCH /orgs/{org}/properties/values Create or update custom property values for organization repositories (batch, max 30 repos)

Acceptance criteria

  • All five value types (string, single_select, multi_select, true_false, url) are supported when creating or updating property definitions
  • Property definitions can be listed for an organization
  • A single property definition can be retrieved by name
  • Property definitions can be created with all supported fields (name, type, description, allowed values, default value, required, editability, require explicit values)
  • Property definitions can be updated
  • Property definitions can be removed
  • Repository custom property values can be set at the organization level (batch)
  • Commands follow the module's naming convention (Verb-GitHubOrganizationCustomProperty)
  • Required permissions are documented (custom properties org admin for schema management, write for value setting)

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions