Pulling email address out of raw author from bitbucket

This commit is contained in:
Dan Cryer 2014-02-24 21:13:40 +00:00
parent 73abea2485
commit 0c125ab962

View file

@ -49,11 +49,14 @@ class WebhookController extends \PHPCI\Controller
foreach ($commits as $commit) {
try {
$email = $commit['raw_author'];
$email = substr($email, 0, strpos($email, '>'));
$email = substr($email, strpos($email, '<') + 1);
$build = new Build();
$build->setProjectId($project);
$build->setCommitId($commit['raw_node']);
$build->setCommitterEmail($commit['raw_author']);
$build->setCommitterEmail($email);
$build->setStatus(Build::STATUS_NEW);
$build->setLog('');
$build->setCreated(new \DateTime());