Skip to content

🚀[Feature]: Add custom property management functions (values + org/enterprise schema) #656

Description

Description

Get-GitHubRepositoryCustomProperty exists, but the module has no way to write custom property values or to manage the property definitions (schema) at the organization or enterprise level. This makes it impossible to drive repository custom properties as a fleet-management control from PowerShell.

Motivating consumer

MSXOrg/Custo (see PR #1) is a policy engine that distributes managed files to subscribing repositories based on their Type and SubscribeTo custom properties, and centrally maintains the allowed values of those properties at the enterprise level. It currently hand-rolls these calls through Invoke-GitHubAPI (and a PAT for the enterprise endpoints). That logic belongs in this module so consumers get consistent objects, ShouldProcess, pagination and retry for free.

Proposed cmdlets

Repository property values

  • Set-GitHubRepositoryCustomPropertyPATCH /repos/{owner}/{repo}/properties/values (create/update/remove values on a repo). Pipeline-friendly with Get-GitHubRepositoryCustomProperty.

Organization property schema (allowed values / definitions)

  • Get-GitHubOrganizationCustomPropertyGET /orgs/{org}/properties/schema and .../schema/{name}
  • Set-GitHubOrganizationCustomPropertyPUT /orgs/{org}/properties/schema/{name}
  • Remove-GitHubOrganizationCustomPropertyDELETE /orgs/{org}/properties/schema/{name}
  • Set-GitHubOrganizationCustomPropertyValuePATCH /orgs/{org}/properties/values (bulk-assign values across repos)

Enterprise property schema (allowed values / definitions)

  • Get-GitHubEnterpriseCustomPropertyGET /enterprises/{enterprise}/properties/schema and .../schema/{name}
  • Set-GitHubEnterpriseCustomPropertyPUT /enterprises/{enterprise}/properties/schema/{name}
  • Remove-GitHubEnterpriseCustomPropertyDELETE /enterprises/{enterprise}/properties/schema/{name}

(Names are suggestions — happy to align with the module's conventions.)

Notes / considerations

  • Auth: enterprise endpoints require enterprise-admin authorization. A GitHub App may use the "Enterprise custom properties for organizations" permission where available; otherwise a PAT with admin:enterprise is required. The cmdlets should work with whichever -Context token is supplied and surface a clear error when the token lacks scope, rather than silently failing.
  • Idempotency: support -WhatIf/SupportsShouldProcess so callers can preview changes (Custo diffs current vs desired before writing).
  • Shape: single_select / multi_select / string / true_false value types, allowed_values, values_editable_by, required, default_value.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions