From bfebf74dee9212eefffe3dd11fd865291fae96dc Mon Sep 17 00:00:00 2001 From: Petr Hudik Date: Thu, 14 Aug 2014 13:15:22 +0200 Subject: [PATCH] Adding commit message and committer e-mail to Git webhook Closes #560 Closes #577 --- PHPCI/Controller/WebhookController.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/PHPCI/Controller/WebhookController.php b/PHPCI/Controller/WebhookController.php index 925cbd89..4274f19c 100644 --- a/PHPCI/Controller/WebhookController.php +++ b/PHPCI/Controller/WebhookController.php @@ -76,10 +76,12 @@ class WebhookController extends \PHPCI\Controller * * @param string $project */ - public function git($project) - { + public function git($project) + { $branch = $this->getParam('branch'); $commit = $this->getParam('commit'); + $commitMessage = $this->getParam('message'); + $committer = $this->getParam('committer'); try { if (empty($branch)) { @@ -90,8 +92,15 @@ class WebhookController extends \PHPCI\Controller $commit = null; } - $this->createBuild($project, $commit, $branch, null, null); + if (empty($commitMessage)) { + $commitMessage = null; + } + if (empty($committer)) { + $committer = null; + } + + $this->createBuild($project, $commit, $branch, $committer, $commitMessage); } catch (\Exception $ex) { header('HTTP/1.1 400 Bad Request'); header('Ex: ' . $ex->getMessage()); @@ -99,7 +108,7 @@ class WebhookController extends \PHPCI\Controller } die('OK'); - } + } /** * Called by Github Webhooks: