Skip to content

feat(enterprise): add resource github_enterprise_custom_property and data source github_enterprise_custom_properties #80

@vmvarela

Description

@vmvarela

Description

Add full CRUD resource for enterprise custom property schema definitions, plus a data source to list them.

Enterprise custom properties allow defining metadata fields that can be applied to all repositories across the enterprise.

go-github v84 API — Property Schema

func (s *EnterpriseService) GetAllCustomProperties(ctx context.Context, enterprise string) ([]*CustomProperty, *Response, error)
// GET /enterprises/{enterprise}/properties/schema

func (s *EnterpriseService) GetCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*CustomProperty, *Response, error)
// GET /enterprises/{enterprise}/properties/schema/{custom_property_name}

func (s *EnterpriseService) CreateOrUpdateCustomProperty(ctx context.Context, enterprise, customPropertyName string, property *CustomProperty) (*CustomProperty, *Response, error)
// PUT /enterprises/{enterprise}/properties/schema/{custom_property_name}

func (s *EnterpriseService) RemoveCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*Response, error)
// DELETE /enterprises/{enterprise}/properties/schema/{custom_property_name}

go-github v84 API — Org Property Values

func (s *EnterpriseService) ListOrganizationCustomPropertyValues(ctx context.Context, enterprise string, opts *ListOptions) ([]*EnterpriseCustomPropertiesValues, *Response, error)
// GET /enterprises/{enterprise}/properties/values

func (s *EnterpriseService) CreateOrUpdateOrganizationCustomPropertyValues(ctx context.Context, enterprise string, values EnterpriseCustomPropertyValuesRequest) (*Response, error)
// PATCH /enterprises/{enterprise}/properties/values

Structs

type CustomProperty struct {
    PropertyName    *string
    ValueType       *string   // "string", "single_select", "multi_select", "true_false"
    Required        *bool
    DefaultValue    interface{}
    Description     *string
    AllowedValues   []string
    ValuesEditableBy *string  // "org_actors", "org_and_repo_actors"
}

Acceptance Criteria

  • Resource github_enterprise_custom_property (schema property CRUD)
  • Data source github_enterprise_custom_properties (list all schema properties)
  • Data source github_enterprise_organization_property_values (list org values) — read-only
  • Import via enterprise_slug:property_name
  • Registered in provider.go
  • Docs for each

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions