@@ -59,6 +59,13 @@ func resourceGithubOrganizationCustomProperties() *schema.Resource {
5959 Computed : true ,
6060 Elem : & schema.Schema {Type : schema .TypeString },
6161 },
62+ "values_editable_by" : {
63+ Description : "Who can edit the values of the custom property. Can be one of 'org_actors' or 'org_and_repo_actors'. If not specified, the default is 'org_actors' (only organization owners can edit values)" ,
64+ Type : schema .TypeString ,
65+ Optional : true ,
66+ Computed : true ,
67+ ValidateDiagFunc : validateValueFunc ([]string {"org_actors" , "org_and_repo_actors" }),
68+ },
6269 },
6370 }
6471}
@@ -78,15 +85,19 @@ func resourceGithubCustomPropertiesCreate(d *schema.ResourceData, meta any) erro
7885 for _ , v := range allowedValues {
7986 allowedValuesString = append (allowedValuesString , v .(string ))
8087 }
88+ valuesEditableBy := d .Get ("values_editable_by" ).(string )
89+
90+ customProperty := & github.CustomProperty {
91+ PropertyName : & propertyName ,
92+ ValueType : valueType ,
93+ Required : & required ,
94+ DefaultValue : & defaultValue ,
95+ Description : & description ,
96+ AllowedValues : allowedValuesString ,
97+ ValuesEditableBy : & valuesEditableBy ,
98+ }
8199
82- customProperty , _ , err := client .Organizations .CreateOrUpdateCustomProperty (ctx , ownerName , d .Get ("property_name" ).(string ), & github.CustomProperty {
83- PropertyName : & propertyName ,
84- ValueType : valueType ,
85- Required : & required ,
86- DefaultValue : & defaultValue ,
87- Description : & description ,
88- AllowedValues : allowedValuesString ,
89- })
100+ customProperty , _ , err := client .Organizations .CreateOrUpdateCustomProperty (ctx , ownerName , d .Get ("property_name" ).(string ), customProperty )
90101 if err != nil {
91102 return err
92103 }
@@ -112,6 +123,7 @@ func resourceGithubCustomPropertiesRead(d *schema.ResourceData, meta any) error
112123 _ = d .Set ("property_name" , customProperty .PropertyName )
113124 _ = d .Set ("required" , customProperty .Required )
114125 _ = d .Set ("value_type" , customProperty .ValueType )
126+ _ = d .Set ("values_editable_by" , customProperty .ValuesEditableBy )
115127
116128 return nil
117129}
0 commit comments