mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2026-05-07 21:17:16 -05:00
[PR #151] [MERGED] fix: Sort releases by published_at instead of created_at #2061
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/RayLabsHQ/gitea-mirror/pull/151
Author: @arunavo4
Created: 11/8/2025
Status: ✅ Merged
Merged: 11/8/2025
Merged by: @arunavo4
Base:
main← Head:148-release-order-fix-for-same-created-date📝 Commits (1)
f5727dafix: Sort releases by published_at instead of created_at📊 Changes
1 file changed (+41 additions, -39 deletions)
View changed files
📝
src/lib/gitea.ts(+41 -39)📄 Description
GitHub's Sorting:
GitHub sorts releases by published_at DESC (newest first)
The API returns them in this order by default
Our Processing:
Fetch releases from GitHub (sorted by published_at DESC)
Sort by published_at DESC, take top N releases
Reverse to process oldest → newest (so oldest gets created first in Gitea)
Create in Gitea with 1-second delays between each
Oldest release → created first → smallest created_unix
Newest release → created last → largest created_unix
Gitea displays sorted by created_unix DESC → newest first
Result: Gitea shows releases in the same order as GitHub ✅
For the Retro-Crisis repo specifically:
GitHub shows: 20250928 (Sep 28) → 20250831 (Aug 31) → 20250825 (Aug 25) → ...
Gitea will now show: 20250928 → 20250831 → 20250825 → ... (same order!)
The key fix was changing from created_at ?? published_at to published_at ?? created_at, because:
created_at = when git tag was created (commit date)
published_at = when release was published on GitHub
For repos where multiple tags share the same commit, they have the same created_at but different published_at dates. Using published_at first ensures we respect the actual release publication order, not just the tag/commit date.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.