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
Creates and a specific custom property for a GitHub repository
5
+
Resource to manage GitHub repository custom properties.
5
6
---
6
7
7
8
# github_repository_custom_property (Resource)
8
9
9
-
This resource allows you to create and manage a specific custom property for a GitHub repository.
10
+
Resource to manage GitHub repository custom properties.
11
+
For more information, see the [GitHub API documentation](https://docs.github.com/rest/metadata/custom-properties#create-or-update-repository-custom-property).
10
12
11
13
## Example Usage
12
14
13
-
> Note that this assumes there already is a custom property defined on the org level called `my-cool-property` of type `string`
14
-
15
15
```terraform
16
+
# NOTE: This assumes there already is a custom property defined on the org level called `my-cool-property` of type `string`
-`repository` - (Required) The repository of the environment.
36
+
-`property_name` (String) Name of the custom property.
37
+
-`property_type` (String) Type of the custom property. Valid values are `string`, `single_select`, `multi_select`, `true_false`, and `url`.
38
+
-`property_value` (Set of String) Value of the custom property. For `string`, `single_select`, `true_false`, and `url` property types, this should be a single value. For `multi_select` property types, this can be multiple values.
39
+
-`repository` (String) Name of the repository.
33
40
34
-
-`property_type` - (Required) Type of the custom property. Can be one of `single_select`, `multi_select`, `string`, or `true_false`
41
+
### Read-Only
35
42
36
-
-`property_name` - (Required) Name of the custom property. Note that a pre-requisiste for this resource is that a custom property of this name has already been defined on the organization level
37
-
38
-
-`property_value` - (Required) Value of the custom property in the form of an array. Properties of type `single_select`, `string`, and `true_false` are represented as a string array of length 1
43
+
-`id` (String) The ID of this resource.
44
+
-`repository_id` (Number) ID of the repository.
39
45
40
46
## Import
41
47
42
-
GitHub Repository Custom Property can be imported using an ID made up of a combination of the names of the organization, repository, custom property separated by a `:` character, e.g.
48
+
Import is supported using the following syntax:
49
+
50
+
In Terraform v1.5.0 and later, the [`import` block](https://developer.hashicorp.com/terraform/language/import) can be used with the `id` attribute, for example:
51
+
52
+
```terraform
53
+
import {
54
+
to = github_repository_custom_property.example
55
+
id = "organization-name:repo-name:custom-property-name"
56
+
}
57
+
```
58
+
59
+
The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
0 commit comments