diff --git a/PHPCI/Controller/WebhookController.php b/PHPCI/Controller/WebhookController.php index d1bf35bb..56ac0bff 100644 --- a/PHPCI/Controller/WebhookController.php +++ b/PHPCI/Controller/WebhookController.php @@ -256,6 +256,21 @@ class WebhookController extends \PHPCI\Controller try { + + // build on merge request events + if (isset($payload['object_kind']) && $payload['object_kind'] == 'merge_request') { + $attributes = $payload['object_attributes']; + if ( $attributes['state'] == 'opened' || $attributes['state'] == 'reopened') { + + $branch = $attributes['source_branch']; + $commit = $attributes['last_commit']; + $committer = $commit['author']['email']; + + $this->createBuild($project, $commit['id'], $branch, $committer, $commit['message'] ); + } + } + + // build on push events if (isset($payload['commits']) && is_array($payload['commits'])) { // If we have a list of commits, then add them all as builds to be tested: diff --git a/composer.lock b/composer.lock index 9b790913..f5e1b0a0 100644 --- a/composer.lock +++ b/composer.lock @@ -172,12 +172,12 @@ "version": "v1.1.1", "source": { "type": "git", - "url": "https://github.com/fabpot/Pimple.git", + "url": "https://github.com/silexphp/Pimple.git", "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fabpot/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d", "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d", "shasum": "" }, @@ -202,9 +202,7 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "email": "fabien@symfony.com" } ], "description": "Pimple is a simple Dependency Injection Container for PHP 5.3",