mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 15:06:27 +00:00
fix: issue pagination/filtering
This commit is contained in:
parent
820a8a8ab5
commit
e0d7784ddb
2 changed files with 9 additions and 7 deletions
|
@ -57,7 +57,7 @@ async function get(path, options, retries = 5) {
|
|||
const linkHeader = parseLinkHeader(res.headers.link);
|
||||
if (linkHeader && linkHeader.next && linkHeader.last) {
|
||||
let lastPage = +linkHeader.last.page;
|
||||
if (!process.env.RENOVATE_PAGINATE_ALL) {
|
||||
if (!process.env.RENOVATE_PAGINATE_ALL && opts.paginate !== 'all') {
|
||||
lastPage = Math.min(pageLimit, lastPage);
|
||||
}
|
||||
const pageNumbers = Array.from(
|
||||
|
|
|
@ -624,14 +624,16 @@ async function getIssueList() {
|
|||
const res = await get(
|
||||
`repos/${config.parentRepo ||
|
||||
config.repository}/issues?creator=${renovateUsername}&state=all&per_page=100&sort=created&direction=asc`,
|
||||
{ paginate: true, useCache: false }
|
||||
{ paginate: 'all', useCache: false }
|
||||
);
|
||||
// istanbul ignore if
|
||||
if (!is.array(res.body)) {
|
||||
logger.warn({ responseBody: res.body }, 'Could not retrieve issue list');
|
||||
return [];
|
||||
}
|
||||
config.issueList = res.body.map(i => ({
|
||||
config.issueList = res.body
|
||||
.filter(issue => !issue.pull_request)
|
||||
.map(i => ({
|
||||
number: i.number,
|
||||
state: i.state,
|
||||
title: i.title,
|
||||
|
|
Loading…
Reference in a new issue