Skip to content

Commit 6af3672

Browse files
Fix PRs without Issue sorting. (#12)
The problem with ordering is fixed.
1 parent f97c2f0 commit 6af3672

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

dist/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31252,8 +31252,9 @@ async function run() {
3125231252
// Fetch pull requests since the latest release
3125331253
const prsSinceLastRelease = await fetchPullRequests(octokit, repoOwner, repoName, latestRelease);
3125431254
console.log(`Found ${prsSinceLastRelease.data.length} closed PRs since last release`);
31255+
const sortedPRs = prsSinceLastRelease.data.sort((a, b) => new Date(a.created_at) - new Date(b.created_at));
3125531256

31256-
for (const pr of prsSinceLastRelease.data) {
31257+
for (const pr of sortedPRs) {
3125731258
if (!await isPrLinkedToIssue(octokit, pr.number, repoOwner, repoName)) {
3125831259
prsWithoutLinkedIssue += `#${pr.number} _${pr.title}_\n`;
3125931260
}

scripts/generate-release-notes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,9 @@ async function run() {
349349
// Fetch pull requests since the latest release
350350
const prsSinceLastRelease = await fetchPullRequests(octokit, repoOwner, repoName, latestRelease);
351351
console.log(`Found ${prsSinceLastRelease.data.length} closed PRs since last release`);
352+
const sortedPRs = prsSinceLastRelease.data.sort((a, b) => new Date(a.created_at) - new Date(b.created_at));
352353

353-
for (const pr of prsSinceLastRelease.data) {
354+
for (const pr of sortedPRs) {
354355
if (!await isPrLinkedToIssue(octokit, pr.number, repoOwner, repoName)) {
355356
prsWithoutLinkedIssue += `#${pr.number} _${pr.title}_\n`;
356357
}

0 commit comments

Comments
 (0)