Skip to content

Commit

Permalink
fix: don't include pre-releases for latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
mtdvlpr authored Dec 10, 2024
1 parent 78f4070 commit 674b63f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,8 @@ export const fetchAnnouncements = async (): Promise<Announcement[]> => {
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<Release[]>(
url,
new URLSearchParams({ per_page: '1' }),
);
return result?.[0]?.tag_name.slice(1);
const result = await fetchJson<Release[]>(url);
return result?.find((r) => !r.prerelease)?.tag_name.slice(1);
};

export const fetchPubMediaLinks = async (
Expand Down

0 comments on commit 674b63f

Please sign in to comment.