Incorrect "latest" pre-release tag is returned
So GitHub does this weird thing where it only sorts releases in reverse chronological order down to the day, then by tag, resulting in (pre)releases showing up out of order on the Releases page:
Even though the Tags page shows the correct chronology:
There's lots of discussion about how this is undesirable behavior here, but it doesn't look like GitHub will fix this any time soon.
This appears to affect this action, where 2024.2.3-pre.e81097e is returned as the "latest" prerelease, presumably because the action is relying on GitHub to return a properly sorted list of releases.
Is it possible to get the correct "latest" prerelease using existing arguments?
Hi! Thanks for the information. I am afraid it's not possible with the current implementation because for the "latest" release the action used GitHub API to get it as an optimised way to resolve it in one request.
Conceptually, it's possible because for other filters supported by the action (but not supported by GitHub API) it iterates over all releases looking for the one that meets the condition.
But as I understand simple filtering by a condition doesn't solve the problem for this case and we need some more complicated logic, such as:
- get "latest"
- iterate and return the first one whose date <= "latest".date
I don't have capacity to solve it now, but PRs are welcome, the action contains tests that can be run locally given that you have a repo that contains problematic releases