31
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-06-04 06:30:47 +00:00

Pull PR directly instead of Issues from Github

This commit is contained in:
Weeblr 2021-03-01 10:52:56 +01:00 committed by GitHub
parent 4f8bb489e8
commit 81d7da37bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -321,7 +321,7 @@ class PullsModel extends AbstractModel
// TODO - Option to configure the batch size
$batchSize = 100;
$pullsResponse = Helper::initializeGithub()->getOpenIssues(
$pullsResponse = Helper::initializeGithub()->getOpenPulls(
$this->getState()->get('github_user'), $this->getState()->get('github_repo'), $page, $batchSize
);
@ -370,8 +370,6 @@ class PullsModel extends AbstractModel
foreach ($pulls as $pull)
{
if (isset($pull->pull_request))
{
// Check if this PR is RTC and has a `PR-` branch label
$isRTC = false;
$branch = '';
@ -393,13 +391,12 @@ class PullsModel extends AbstractModel
(int) $pull->number,
$this->getDb()->quote(HTMLHelper::_('string.truncate', $pull->title, 150)),
$this->getDb()->quote(HTMLHelper::_('string.truncate', $pull->body, 100)),
$this->getDb()->quote($pull->pull_request->html_url),
$this->getDb()->quote($pull->html_url),
(int) $isRTC,
$this->getDb()->quote($branch),
);
$data[] = implode(',', $pullData);
}
}
// If there are no pulls to insert then bail, assume we're finished