modify created status code to 201

This commit is contained in:
niuhuan 2022-03-22 13:10:44 +08:00
commit cdaef81aa7
1 changed files with 3 additions and 2 deletions

View File

@ -55,6 +55,7 @@ func main() {
url := fmt.Sprintf("https://api.github.com/repos/%v/%v/releases", owner, repo)
body := map[string]interface{}{
"tag_name": version.Code,
"target_commitish": mainBranch,
"name": version.Code,
"body": version.Info,
"draft": true,
@ -78,13 +79,13 @@ func main() {
panic(nil)
}
defer createReleaseResponse.Body.Close()
if createReleaseResponse.StatusCode != 200 {
if createReleaseResponse.StatusCode != 201 {
buff, err = ioutil.ReadAll(createReleaseResponse.Body)
if err != nil {
panic(nil)
}
println(string(buff))
panic("NOT 200")
panic("NOT 201")
}
}
}