integrations / integrations/terraform-provider-github

[FEAT]: add github_repository_custom_properties resource for batch property management

Open
#3,240 1 comment 0 reactions 0 assignees View on GitHub
New resource r/repository_custom_properties Type: Feature
Dominant language
Go
Stars
1.2k
Forks
1k
Avg merge
1d 14h
Merged PRs (30d)
8

Description

## Summary

Add a new `github_repository_custom_properties` resource (plural) that manages **multiple** custom property values for a single repository in one resource block, with in-place updates when values change.

## Motivation

The existing `github_repository_custom_property` (singular) resource manages a single property per resource instance. While this works well for independent lifecycle management, there are common use cases where managing all properties for a repository as a unit is preferred:

- **Atomic updates**: Set multiple property values in a single API call rather than one resource per property
- **Simplified configuration**: Manage all properties for a repo in a single resource block instead of N separate resources
- **In-place updates**: When a property value changes, the resource updates in-place rather than needing destroy/recreate
- **Clean imports**: Import all current property values from a repository in one `terraform import` command

## Proposed Schema

```hcl
resource "github_repository_custom_properties" "example" {
repository_name = "my-repo"

property {
name = "environment"
value = ["production"]
}

property {
name = "languages"
value = ["go", "typescript"] # multi_select
}
}
```

## Implementation Notes

- Uses the batch `CreateOrUpdateCustomProperties` API endpoint for efficient updates
- Auto-detects property types from org-level property definitions (no `property_type` field needed)
- Import format: `terraform import github_repository_custom_properties.example owner/repo-name`
- Complements (does not replace) the existing singular `github_repository_custom_property` resource

## Related

- Existing singular resource: `github_repository_custom_property`
- Organization property definitions: `github_organization_custom_properties`
- Issue #2936 (naming discussion for org custom properties plural vs singular)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.