From cc86e85adb6224cc7d9b5778d79bddf3656a8671 Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Thu, 10 Oct 2013 01:38:32 +0100 Subject: [PATCH] Fixing Github Controller to ignore all-zeroes commit IDs --- PHPCI/Controller/GithubController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PHPCI/Controller/GithubController.php b/PHPCI/Controller/GithubController.php index d59333b9..b616cbb4 100644 --- a/PHPCI/Controller/GithubController.php +++ b/PHPCI/Controller/GithubController.php @@ -38,6 +38,12 @@ class GithubController extends \PHPCI\Controller { $payload = json_decode($this->getParam('payload'), true); + // Github sends a payload when you close a pull request with a + // non-existant commit. We don't want this. + if ($payload['after'] === '0000000000000000000000000000000000000000') { + die('OK'); + } + try { $build = new Build(); $build->setProjectId($project);