Fix github webhook payload detection logic (#728)

The correct value for "package_type" seems to be "CONTAINER" instead of
"docker"
ioutil^2
Chakrit Wichian 2024-11-06 14:22:36 +07:00 committed by GitHub
parent 10acf52919
commit 34566aa802
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -120,9 +120,9 @@ func (s *TriggerServer) githubHandler(resp http.ResponseWriter, req *http.Reques
return
}
if payload.RegistryPackage.PackageType != "docker" {
if payload.RegistryPackage.PackageType != "CONTAINER" {
resp.WriteHeader(http.StatusBadRequest)
fmt.Fprintf(resp, "registry package type was not docker")
fmt.Fprintf(resp, "registry package type was not CONTAINER")
}
if payload.Repository.FullName == "" { // github package name

View File

@ -13,7 +13,7 @@ var fakeGithubPackageWebhook = `{
"registry_package": {
"id": 35087,
"name": "server",
"package_type": "docker",
"package_type": "CONTAINER",
"html_url": "https://github.com/DingGGu/UtaiteBOX/packages/35087",
"created_at": "2019-10-11T18:18:58Z",
"updated_at": "2019-10-11T18:18:58Z",