use a 202 if the asset was already published
authorMichael Wallner <mike@php.net>
Wed, 3 Jun 2015 11:40:05 +0000 (13:40 +0200)
committerMichael Wallner <mike@php.net>
Wed, 3 Jun 2015 11:40:05 +0000 (13:40 +0200)
app/Controller/Github/Hook/Receive.php

index 1ac998477d3493898fa98716caf903653358f271..4af889993cb58d8a45ce66131519b437573cd7e1 100644 (file)
@@ -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;
                                }
                        }