parent
067a60983f
commit
60131ae7b6
|
@ -260,12 +260,14 @@ class WebhookController extends \b8\Controller
|
||||||
$committer = $commit['commit']['author']['email'];
|
$committer = $commit['commit']['author']['email'];
|
||||||
$message = $commit['commit']['message'];
|
$message = $commit['commit']['message'];
|
||||||
|
|
||||||
|
$remoteUrlKey = $payload['pull_request']['head']['repo']['private'] ? 'ssh_url' : 'clone_url';
|
||||||
|
|
||||||
$extra = array(
|
$extra = array(
|
||||||
'build_type' => 'pull_request',
|
'build_type' => 'pull_request',
|
||||||
'pull_request_id' => $payload['pull_request']['id'],
|
'pull_request_id' => $payload['pull_request']['id'],
|
||||||
'pull_request_number' => $payload['number'],
|
'pull_request_number' => $payload['number'],
|
||||||
'remote_branch' => $payload['pull_request']['head']['ref'],
|
'remote_branch' => $payload['pull_request']['head']['ref'],
|
||||||
'remote_url' => $payload['pull_request']['head']['repo']['clone_url'],
|
'remote_url' => $payload['pull_request']['head']['repo'][$remoteUrlKey],
|
||||||
);
|
);
|
||||||
|
|
||||||
$results[$id] = $this->createBuild($project, $id, $branch, $committer, $message, $extra);
|
$results[$id] = $this->createBuild($project, $id, $branch, $committer, $message, $extra);
|
||||||
|
|
|
@ -125,7 +125,7 @@ class GithubBuild extends RemoteGitBuild
|
||||||
|
|
||||||
if ($this->getExtra('build_type') == 'pull_request') {
|
if ($this->getExtra('build_type') == 'pull_request') {
|
||||||
$matches = array();
|
$matches = array();
|
||||||
preg_match('/\/([a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+)/', $this->getExtra('remote_url'), $matches);
|
preg_match('/[\/:]([a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+)/', $this->getExtra('remote_url'), $matches);
|
||||||
|
|
||||||
$reference = $matches[1];
|
$reference = $matches[1];
|
||||||
$branch = $this->getExtra('remote_branch');
|
$branch = $this->getExtra('remote_branch');
|
||||||
|
|
Loading…
Reference in a new issue