Merge pull request #78 from StudioMaX/github-pull-requests

Fixed ability to fetch private pull requests on Github
This commit is contained in:
Dmitry Khomutov 2017-06-09 19:04:52 +07:00 committed by GitHub
commit 80c3ce4fe0

View file

@ -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;