diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2022-08-18 11:17:24 +0300 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2022-08-18 11:17:24 +0300 |
commit | 9688ff7a092b06549914e12767d23c0d4f128c85 (patch) | |
tree | 739f59276f33b87ded26eae367bd42d8fa9aef16 | |
parent | b3b77807ca6eb528ba506acb03e31d143210797b (diff) |
Fix graphql error if no PR to check
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
-rw-r--r-- | changelog/index.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/changelog/index.php b/changelog/index.php index eb664ca..1e4db32 100644 --- a/changelog/index.php +++ b/changelog/index.php @@ -333,12 +333,18 @@ QUERY; QUERY; $progressBar->setMessage("Fetching PR titles for $repoName ..."); - $response = $client->api('graphql')->execute($query); + if (count($pullRequests) === 0) { + $progressBar->advance(); + continue; + } + + $response = $client->api('graphql')->execute($query); if (!isset($response['data']['repository'])) { $progressBar->advance(); continue; } + foreach ($response['data']['repository'] as $pr) { if ($this->shouldPRBeSkipped($pr['title'])) { continue; |