You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This example matches the user's requested format with native HCL lists
53
+
resource "github_repository" "example" {
54
+
name = "example"
55
+
description = "My awesome codebase"
56
+
57
+
custom_property {
58
+
name = "foo"
59
+
value = ["bar"]
60
+
}
61
+
62
+
custom_property {
63
+
name = "boolean"
64
+
value = ["false"]
65
+
}
66
+
67
+
custom_property {
68
+
name = "multiselect"
69
+
value = ["goo", "zoo"]
70
+
}
71
+
72
+
custom_property {
73
+
name = "singleselect"
74
+
value = ["acme"]
75
+
}
76
+
}
77
+
```
78
+
79
+
## Example Usage with Collaborative Custom Property Management
80
+
81
+
The following example illustrates collaborative management of repository custom properties by setting `exclusive_custom_properties = false` and delegating an additional property to the standalone `github_repository_custom_property` resource.
82
+
83
+
```terraform
84
+
# This example demonstrates collaborative management of repository custom properties.
85
+
# It assumes the organization already defines the referenced custom properties.
86
+
87
+
resource "github_repository" "example" {
88
+
name = "example-shared-custom-props"
89
+
description = "Repository with collaboratively managed custom properties"
-`archive_on_destroy` (Boolean) Set to 'true' to archive the repository instead of deleting on destroy.
64
122
-`archived` (Boolean) Specifies if the repository should be archived. Defaults to 'false'. NOTE Currently, the API does not support unarchiving.
65
123
-`auto_init` (Boolean) Set to 'true' to produce an initial commit in the repository.
124
+
-`custom_property` (Block Set) Custom properties for the repository. (see [below for nested schema](#nestedblock--custom_property))
66
125
-`default_branch` (String, Deprecated) Can only be set after initial repository creation, and only if the target branch exists
67
126
-`delete_branch_on_merge` (Boolean) Automatically delete head branch after a pull request is merged. Defaults to 'false'.
68
127
-`description` (String) A description of the repository.
128
+
-`exclusive_custom_properties` (Boolean) Whether this resource exclusively manages all custom properties. Defaults to 'true'; if set to 'false', only properties defined in custom_property blocks will be managed by this resource, allowing collaborative management of custom property settings.
69
129
-`gitignore_template` (String) Use the name of the template without the extension. For example, 'Haskell'.
70
130
-`has_discussions` (Boolean) Set to 'true' to enable GitHub Discussions on the repository. Defaults to 'false'.
71
131
-`has_downloads` (Boolean) Set to 'true' to enable the (deprecated) downloads features on the repository.
-`ssh_clone_url` (String) URL that can be provided to 'git clone' to clone the repository via SSH.
104
165
-`svn_url` (String) URL that can be provided to 'svn checkout' to check out the repository via GitHub's Subversion protocol emulation.
105
166
167
+
<aid="nestedblock--custom_property"></a>
168
+
### Nested Schema for `custom_property`
169
+
170
+
Required:
171
+
172
+
-`name` (String) The name of the custom property.
173
+
-`value` (List of String) The value(s) of the custom property. For single-value properties, provide a list with one element. For multi-select properties, provide multiple elements.
-`value_type` - (Required) Type of the value for the property. Can be one of: `single_select`, `multi_select`, `string`, `true_false`
23
+
-`required` - (Optional) Whether the property is required. Defaults to `false`
24
+
-`default_value` - (Optional) Default value of the property
25
+
-`description` - (Optional) A short description of the property
26
+
-`allowed_values` - (Optional) List of allowed values for the property. Only applies when `value_type` is `single_select` or `multi_select`
27
+
-`values_editable_by` - (Optional) Who can edit the values of the property. Can be one of: `org_actors`, `org_and_repo_actors`. Defaults to `org_actors`
0 commit comments