Skip to content

Commit

Permalink
Fix broken CreateOrUpdateRepoCustomPropertyValues (google#3023)
Browse files Browse the repository at this point in the history
Fixes: google#3021.
  • Loading branch information
peter-aglen authored and gmlewis committed Dec 19, 2023
1 parent 9f70f1f commit 5e63691
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions github/orgs_properties.go
Expand Up @@ -178,12 +178,12 @@ func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org
// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories
//
//meta:operation PATCH /orgs/{org}/properties/values
func (s *OrganizationsService) CreateOrUpdateRepoCustomPropertyValues(ctx context.Context, org string, repoNames []string, properties []*CustomProperty) (*Response, error) {
func (s *OrganizationsService) CreateOrUpdateRepoCustomPropertyValues(ctx context.Context, org string, repoNames []string, properties []*CustomPropertyValue) (*Response, error) {
u := fmt.Sprintf("orgs/%v/properties/values", org)

params := struct {
RepositoryNames []string `json:"repository_names"`
Properties []*CustomProperty `json:"properties"`
RepositoryNames []string `json:"repository_names"`
Properties []*CustomPropertyValue `json:"properties"`
}{
RepositoryNames: repoNames,
Properties: properties,
Expand Down
8 changes: 4 additions & 4 deletions github/orgs_properties_test.go
Expand Up @@ -347,14 +347,14 @@ func TestOrganizationsService_CreateOrUpdateRepoCustomPropertyValues(t *testing.

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

ctx := context.Background()
_, err := client.Organizations.CreateOrUpdateRepoCustomPropertyValues(ctx, "o", []string{"repo"}, []*CustomProperty{
_, err := client.Organizations.CreateOrUpdateRepoCustomPropertyValues(ctx, "o", []string{"repo"}, []*CustomPropertyValue{
{
PropertyName: String("service"),
ValueType: "string",
PropertyName: "service",
Value: String("string"),
},
})
if err != nil {
Expand Down

0 comments on commit 5e63691

Please sign in to comment.