From 674b63f785529afe09e4f7e6f4d9324ed1387763 Mon Sep 17 00:00:00 2001 From: Manoah Tervoort <46671786+mtdvlpr@users.noreply.github.com> Date: Tue, 10 Dec 2024 23:30:05 +0100 Subject: [PATCH] fix: don't include pre-releases for latest version --- src/utils/api.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/utils/api.ts b/src/utils/api.ts index c2e1444ee..f54300899 100644 --- a/src/utils/api.ts +++ b/src/utils/api.ts @@ -134,11 +134,8 @@ export const fetchAnnouncements = async (): Promise => { export const fetchLatestVersion = async () => { if (!process.env.repository) return; const url = `${process.env.repository.replace('github.com', 'api.github.com/repos')}/releases`; - const result = await fetchJson( - url, - new URLSearchParams({ per_page: '1' }), - ); - return result?.[0]?.tag_name.slice(1); + const result = await fetchJson(url); + return result?.find((r) => !r.prerelease)?.tag_name.slice(1); }; export const fetchPubMediaLinks = async (