X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=app%2FGithub%2FAPI%2FHooks%2FCreateHook.php;h=866e93964236bdd12bccdb95c2025d5db3368553;hb=a2af03951ac7fbd032609d0044c0a85704b77771;hp=325dca7fc32528a4e435724c4e7eea7a53bed0d4;hpb=25b99959b9e66d00681092977c23b5df32ead5f4;p=pharext%2Fpharext.org diff --git a/app/Github/API/Hooks/CreateHook.php b/app/Github/API/Hooks/CreateHook.php index 325dca7..866e939 100644 --- a/app/Github/API/Hooks/CreateHook.php +++ b/app/Github/API/Hooks/CreateHook.php @@ -15,7 +15,8 @@ class CreateHook extends Call "Accept" => $this->config->api->accept, "Content-Type" => "application/json", ]); - + + $events = []; if (!empty($this->args["conf"]["tag"])) { $events[] = "create"; } @@ -35,7 +36,7 @@ class CreateHook extends Call ])); $this->api->getClient()->enqueue($request, function($response) use($callback) { - if ($response->getReesponseCode() != 400 || null === ($json = json_decode($response->getBody()))) { + if ($response->getResponseCode() >= 400 || null === ($json = json_decode($response->getBody()))) { throw new RequestException($response); } $callback($json);