- fix bailing out if the max amount of PRs is reached
This commit is contained in:
+3
-2
@@ -842,7 +842,8 @@ class PullRequests {
|
|||||||
mergedPRs.push(mapPullRequest(pr, 'merged'));
|
mergedPRs.push(mapPullRequest(pr, 'merged'));
|
||||||
}
|
}
|
||||||
if (mergedPRs.length >= maxPullRequests) {
|
if (mergedPRs.length >= maxPullRequests) {
|
||||||
core.warning(`⚠️ Reached 'maxPullRequests' count ${maxPullRequests}`);
|
core.warning(`⚠️ Reached 'maxPullRequests' count ${maxPullRequests} (1)`);
|
||||||
|
break; // bail out early to not keep iterating forever
|
||||||
}
|
}
|
||||||
else if (prs.length > 0) {
|
else if (prs.length > 0) {
|
||||||
if (fetchedEnough(prs, fromDate)) {
|
if (fetchedEnough(prs, fromDate)) {
|
||||||
@@ -889,7 +890,7 @@ class PullRequests {
|
|||||||
const firstPR = prs[0];
|
const firstPR = prs[0];
|
||||||
if (firstPR === undefined || openPrs.length >= maxPullRequests) {
|
if (firstPR === undefined || openPrs.length >= maxPullRequests) {
|
||||||
if (openPrs.length >= maxPullRequests) {
|
if (openPrs.length >= maxPullRequests) {
|
||||||
core.warning(`⚠️ Reached 'maxPullRequests' count ${maxPullRequests}`);
|
core.warning(`⚠️ Reached 'maxPullRequests' count ${maxPullRequests} (2)`);
|
||||||
}
|
}
|
||||||
break; // bail out early to not keep iterating forever
|
break; // bail out early to not keep iterating forever
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -138,7 +138,8 @@ export class PullRequests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mergedPRs.length >= maxPullRequests) {
|
if (mergedPRs.length >= maxPullRequests) {
|
||||||
core.warning(`⚠️ Reached 'maxPullRequests' count ${maxPullRequests}`)
|
core.warning(`⚠️ Reached 'maxPullRequests' count ${maxPullRequests} (1)`)
|
||||||
|
break // bail out early to not keep iterating forever
|
||||||
} else if (prs.length > 0) {
|
} else if (prs.length > 0) {
|
||||||
if (fetchedEnough(prs, fromDate)) {
|
if (fetchedEnough(prs, fromDate)) {
|
||||||
return sortPrs(mergedPRs) // bail out early to not keep iterating on PRs super old
|
return sortPrs(mergedPRs) // bail out early to not keep iterating on PRs super old
|
||||||
@@ -173,7 +174,7 @@ export class PullRequests {
|
|||||||
const firstPR = prs[0]
|
const firstPR = prs[0]
|
||||||
if (firstPR === undefined || openPrs.length >= maxPullRequests) {
|
if (firstPR === undefined || openPrs.length >= maxPullRequests) {
|
||||||
if (openPrs.length >= maxPullRequests) {
|
if (openPrs.length >= maxPullRequests) {
|
||||||
core.warning(`⚠️ Reached 'maxPullRequests' count ${maxPullRequests}`)
|
core.warning(`⚠️ Reached 'maxPullRequests' count ${maxPullRequests} (2)`)
|
||||||
}
|
}
|
||||||
break // bail out early to not keep iterating forever
|
break // bail out early to not keep iterating forever
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user