mirror of
https://github.com/goreleaser/goreleaser-action
synced 2026-06-29 22:37:30 +00:00
fix: nightly resolution to select newest published release (#562)
* fix(nightly): pick latest nightly by published_at GitHub's /releases endpoint is not reliably ordered by published_at, so resolveNightly could pick an older nightly than the most recent one. Filter, sort by published_at desc, and take the first. * test(nightly): add regression coverage for release ordering --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -104,3 +104,16 @@ describe('getRelease', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('latestNightlyRelease', () => {
|
||||
it('returns the newest nightly by published_at even when API order is wrong', () => {
|
||||
const release = github.latestNightlyRelease([
|
||||
{tag_name: 'v2.16.0-c9b458fa-nightly', published_at: '2026-05-12T01:27:50Z'},
|
||||
{tag_name: 'v2.16.0-6724de64-nightly', published_at: '2026-05-13T01:32:53Z'},
|
||||
{tag_name: 'v2.16.0-2827930b-nightly', published_at: '2026-05-17T01:34:11Z'},
|
||||
{tag_name: 'v2.15.4', published_at: '2026-04-21T14:07:57Z'}
|
||||
]);
|
||||
|
||||
expect(release?.tag_name).toEqual('v2.16.0-2827930b-nightly');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user