Skip to content

Commit c135be9

Browse files
authored
Fix broken CreateOrUpdateRepoCustomPropertyValues (#3023)
Fixes: #3021.
1 parent 1e66201 commit c135be9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

github/orgs_properties.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org
178178
// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories
179179
//
180180
//meta:operation PATCH /orgs/{org}/properties/values
181-
func (s *OrganizationsService) CreateOrUpdateRepoCustomPropertyValues(ctx context.Context, org string, repoNames []string, properties []*CustomProperty) (*Response, error) {
181+
func (s *OrganizationsService) CreateOrUpdateRepoCustomPropertyValues(ctx context.Context, org string, repoNames []string, properties []*CustomPropertyValue) (*Response, error) {
182182
u := fmt.Sprintf("orgs/%v/properties/values", org)
183183

184184
params := struct {
185-
RepositoryNames []string `json:"repository_names"`
186-
Properties []*CustomProperty `json:"properties"`
185+
RepositoryNames []string `json:"repository_names"`
186+
Properties []*CustomPropertyValue `json:"properties"`
187187
}{
188188
RepositoryNames: repoNames,
189189
Properties: properties,

github/orgs_properties_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,14 +347,14 @@ func TestOrganizationsService_CreateOrUpdateRepoCustomPropertyValues(t *testing.
347347

348348
mux.HandleFunc("/orgs/o/properties/values", func(w http.ResponseWriter, r *http.Request) {
349349
testMethod(t, r, "PATCH")
350-
testBody(t, r, `{"repository_names":["repo"],"properties":[{"property_name":"service","value_type":"string"}]}`+"\n")
350+
testBody(t, r, `{"repository_names":["repo"],"properties":[{"property_name":"service","value":"string"}]}`+"\n")
351351
})
352352

353353
ctx := context.Background()
354-
_, err := client.Organizations.CreateOrUpdateRepoCustomPropertyValues(ctx, "o", []string{"repo"}, []*CustomProperty{
354+
_, err := client.Organizations.CreateOrUpdateRepoCustomPropertyValues(ctx, "o", []string{"repo"}, []*CustomPropertyValue{
355355
{
356-
PropertyName: String("service"),
357-
ValueType: "string",
356+
PropertyName: "service",
357+
Value: String("string"),
358358
},
359359
})
360360
if err != nil {

0 commit comments

Comments
 (0)