From f511ab7a63d5c0e5b3d2798300cb5391f89a879f Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Sat, 14 Dec 2024 02:04:10 +0100 Subject: [PATCH] fix(core): Fix sorting order of tagged commits by timestamp --- changelog.md | 5 +++++ ts/00_commitinfo_data.ts | 2 +- ts/index.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 383f0d5..bc39c2d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Changelog +## 2024-12-14 - 1.6.2 - fix(core) +Fix sorting order of tagged commits by timestamp + +- Fixed the sorting order of commits to be by timestamp in descending order after filtering for tagged commits. + ## 2024-12-14 - 1.6.1 - fix(docs) Updated project metadata and expanded documentation for installation and usage. diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index f23de12..8c053e9 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@foss.global/codefeed', - version: '1.6.1', + version: '1.6.2', description: 'The @foss.global/codefeed module is designed for generating feeds from Gitea repositories, enhancing development workflows by processing commit data and repository activities.' } diff --git a/ts/index.ts b/ts/index.ts index 31830c8..801427b 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -326,7 +326,7 @@ export class CodeFeed { console.log(`Processed ${allCommits.length} commits in total.`); - allCommits = allCommits.filter(commitArg => commitArg.tagged); + allCommits = allCommits.filter(commitArg => commitArg.tagged).sort((a, b) => b.timestamp.localeCompare(a.timestamp)); console.log(`Filtered to ${allCommits.length} commits with tagged statuses.`);