From 63a2b59244676e2fcad2ef312bb3976988c08364 Mon Sep 17 00:00:00 2001 From: StudioMaX Date: Fri, 9 Jun 2017 02:13:17 +0600 Subject: [PATCH] Fixed ability to fetch private pull requests on Github --- src/PHPCensor/Model/Build/GithubBuild.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PHPCensor/Model/Build/GithubBuild.php b/src/PHPCensor/Model/Build/GithubBuild.php index 00dd2dc2..ae020eba 100644 --- a/src/PHPCensor/Model/Build/GithubBuild.php +++ b/src/PHPCensor/Model/Build/GithubBuild.php @@ -174,14 +174,14 @@ class GithubBuild extends RemoteGitBuild try { if (!empty($buildType) && $buildType == 'pull_request') { - $remoteUrl = $this->getExtra('remote_url'); - $remoteBranch = $this->getExtra('remote_branch'); + $pullRequestId = $this->getExtra('pull_request_number'); - $cmd = 'cd "%s" && git checkout -b php-censor/' . $this->getId() . ' %s && git pull -q --no-edit %s %s'; + $cmd = 'cd "%s" && git checkout -b php-censor/' . $this->getId() + . ' %s && git pull -q --no-edit origin pull/%s/head'; if (!empty($extra['git_ssh_wrapper'])) { $cmd = 'export GIT_SSH="'.$extra['git_ssh_wrapper'].'" && ' . $cmd; } - $success = $builder->executeCommand($cmd, $cloneTo, $this->getBranch(), $remoteUrl, $remoteBranch); + $success = $builder->executeCommand($cmd, $cloneTo, $this->getBranch(), $pullRequestId); } } catch (\Exception $ex) { $success = false;