From 0e83d471fe51c890397802d9d963be0e30f0ed8a Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Tue, 3 Jul 2018 11:53:09 +0200
Subject: [PATCH] feat(github): pagination page limit

---
 lib/platform/github/gh-got-wrapper.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/platform/github/gh-got-wrapper.js b/lib/platform/github/gh-got-wrapper.js
index 307dc0a509..b628009ab7 100644
--- a/lib/platform/github/gh-got-wrapper.js
+++ b/lib/platform/github/gh-got-wrapper.js
@@ -32,11 +32,12 @@ async function get(path, opts, retries = 5) {
     const res = await ghGot(path, opts);
     if (opts.paginate) {
       // Check if result is paginated
+      const pageLimit = opts.pageLimit || 10;
       const linkHeader = parseLinkHeader(res.headers.link);
       if (linkHeader && linkHeader.next && linkHeader.last) {
         let lastPage = +linkHeader.last.page;
         if (!process.env.RENOVATE_PAGINATE_ALL) {
-          lastPage = Math.min(10, lastPage);
+          lastPage = Math.min(pageLimit, lastPage);
         }
         const pageNumbers = Array.from(
           new Array(lastPage),
-- 
GitLab