Merge pull request #8653 from cli/wm/fix-label-create-regression

Fix label create regression in v2.43.0
This commit is contained in:
Andy Feller 2024-01-31 16:04:12 -05:00 committed by GitHub
commit dd25f885dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -137,8 +137,7 @@ func createLabel(client *http.Client, repo ghrepo.Interface, opts *createOptions
return err
}
requestBody := bytes.NewReader(requestByte)
result := label{}
err = apiClient.REST(repo.RepoHost(), "POST", path, requestBody, &result)
err = apiClient.REST(repo.RepoHost(), "POST", path, requestBody, nil)
if httpError, ok := err.(api.HTTPError); ok && isLabelAlreadyExistsError(httpError) {
err = errLabelAlreadyExists
@ -173,8 +172,7 @@ func updateLabel(apiClient *api.Client, repo ghrepo.Interface, opts *editOptions
return err
}
requestBody := bytes.NewReader(requestByte)
result := label{}
err = apiClient.REST(repo.RepoHost(), "PATCH", path, requestBody, &result)
err = apiClient.REST(repo.RepoHost(), "PATCH", path, requestBody, nil)
if httpError, ok := err.(api.HTTPError); ok && isLabelAlreadyExistsError(httpError) {
err = errLabelAlreadyExists