Update to only build the latest commit from a Github pull request webhook.

This commit is contained in:
Dan Cryer 2015-03-10 20:20:54 +00:00
parent a188afb0da
commit 5f2de9a679

View file

@ -232,6 +232,11 @@ class WebhookController extends \PHPCI\Controller
}
foreach ($response['body'] as $commit) {
// Skip all but the current HEAD commit ID:
if ($commit['sha'] != $payload['head']['sha']) {
continue;
}
$branch = str_replace('refs/heads/', '', $payload['pull_request']['base']['ref']);
$committer = $commit['commit']['author']['email'];
$message = $commit['commit']['message'];