- sort by updated instead of merged
- FIX https://github.com/mikepenz/release-changelog-builder-action/issues/1300
This commit is contained in:
+6
-4
@@ -2145,7 +2145,7 @@ class GithubRepository extends BaseRepository_1.BaseRepository {
|
|||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
state: 'closed',
|
state: 'closed',
|
||||||
sort: 'merged',
|
sort: 'updated',
|
||||||
per_page: `${Math.min(100, maxPullRequests)}`,
|
per_page: `${Math.min(100, maxPullRequests)}`,
|
||||||
direction: 'desc'
|
direction: 'desc'
|
||||||
});
|
});
|
||||||
@@ -2379,11 +2379,13 @@ class GithubRepository extends BaseRepository_1.BaseRepository {
|
|||||||
}
|
}
|
||||||
fetchedEnough(pullRequests, fromDate) {
|
fetchedEnough(pullRequests, fromDate) {
|
||||||
for (let i = 0; i < Math.min(pullRequests.length, 3); i++) {
|
for (let i = 0; i < Math.min(pullRequests.length, 3); i++) {
|
||||||
|
// we get PRs paged by updated timestamp, there is a chance that PRs come out of merged order as a result of this
|
||||||
|
// ensure we get enough PRs to cover the expected spectrum.
|
||||||
const firstPR = pullRequests[i];
|
const firstPR = pullRequests[i];
|
||||||
if (!firstPR.merged_at) {
|
if (!firstPR.updated_at) {
|
||||||
// no merged_at timestamp -> look for the next
|
// no updated_at timestamp -> look for the next
|
||||||
}
|
}
|
||||||
else if (fromDate.isAfter((0, moment_1.default)(firstPR.merged_at))) {
|
else if (fromDate.isAfter((0, moment_1.default)(firstPR.updated_at))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -100,7 +100,7 @@ export class GithubRepository extends BaseRepository {
|
|||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
state: 'closed',
|
state: 'closed',
|
||||||
sort: 'merged',
|
sort: 'updated',
|
||||||
per_page: `${Math.min(100, maxPullRequests)}`,
|
per_page: `${Math.min(100, maxPullRequests)}`,
|
||||||
direction: 'desc'
|
direction: 'desc'
|
||||||
})
|
})
|
||||||
@@ -291,10 +291,12 @@ export class GithubRepository extends BaseRepository {
|
|||||||
|
|
||||||
private fetchedEnough(pullRequests: PullsListData, fromDate: moment.Moment): boolean {
|
private fetchedEnough(pullRequests: PullsListData, fromDate: moment.Moment): boolean {
|
||||||
for (let i = 0; i < Math.min(pullRequests.length, 3); i++) {
|
for (let i = 0; i < Math.min(pullRequests.length, 3); i++) {
|
||||||
|
// we get PRs paged by updated timestamp, there is a chance that PRs come out of merged order as a result of this
|
||||||
|
// ensure we get enough PRs to cover the expected spectrum.
|
||||||
const firstPR = pullRequests[i]
|
const firstPR = pullRequests[i]
|
||||||
if (!firstPR.merged_at) {
|
if (!firstPR.updated_at) {
|
||||||
// no merged_at timestamp -> look for the next
|
// no updated_at timestamp -> look for the next
|
||||||
} else if (fromDate.isAfter(moment(firstPR.merged_at))) {
|
} else if (fromDate.isAfter(moment(firstPR.updated_at))) {
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
break // not enough PRs yet, go further
|
break // not enough PRs yet, go further
|
||||||
|
|||||||
Reference in New Issue
Block a user