From: Michael Wallner Date: Wed, 3 Jun 2015 11:40:05 +0000 (+0200) Subject: use a 202 if the asset was already published X-Git-Url: https://git.m6w6.name/?p=pharext%2Fpharext.org;a=commitdiff_plain;h=8218e7f0e7eed6bba889dee119e4db7a9b236a86 use a 202 if the asset was already published --- diff --git a/app/Controller/Github/Hook/Receive.php b/app/Controller/Github/Hook/Receive.php index 1ac9984..4af8899 100644 --- a/app/Controller/Github/Hook/Receive.php +++ b/app/Controller/Github/Hook/Receive.php @@ -67,7 +67,6 @@ class Receive implements Controller function release($release) { if ($release->action !== "published") { $response = $this->app->getResponse(); - $response->setResponseCode(202); $response->getBody()->append("Not published"); return; @@ -76,6 +75,9 @@ class Receive implements Controller foreach ($release->release->assets as $asset) { if ($asset->content_type === "application/phar") { /* we've already uploaded the asset when we created the release */ + $response = $this->app->getResponse(); + $response->setResponseCode(202); + $response->getBody()->append("Already published"); return; } }