From 171cdf372b237c452a0a4f12d5850e432486b38f Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Wed, 28 Mar 2018 06:04:25 +0200
Subject: [PATCH] fix: add option for unlimited pagination
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Set env variable RENOVATE_PAGINATE_ALL to disable Renovate’s regular limiting of 1000 results (unlimited results will be returned).
---
 lib/platform/github/gh-got-wrapper.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/platform/github/gh-got-wrapper.js b/lib/platform/github/gh-got-wrapper.js
index 20fbd9ec1a..23f801667f 100644
--- a/lib/platform/github/gh-got-wrapper.js
+++ b/lib/platform/github/gh-got-wrapper.js
@@ -37,7 +37,11 @@ async function get(path, opts, retries = 5) {
     if (opts && opts.paginate) {
       // Check if result is paginated
       const linkHeader = parseLinkHeader(res.headers.link);
-      if (linkHeader && linkHeader.next && linkHeader.next.page !== '11') {
+      if (
+        linkHeader &&
+        linkHeader.next &&
+        (process.env.RENOVATE_PAGINATE_ALL || linkHeader.next.page !== '11')
+      ) {
         res.body = res.body.concat(
           (await get(linkHeader.next.url, opts, retries)).body
         );
-- 
GitLab