From 06552702cef458112d085aa8998ad375d5342385 Mon Sep 17 00:00:00 2001 From: Adil Hanney Date: Sat, 2 Dec 2023 03:29:53 +0000 Subject: [PATCH] fix: use latest tag not release Release hasn't been made when the action is called by repository dispatch --- src/app/page.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index b9f138b..10f367e 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -11,9 +11,10 @@ import assert from 'assert'; * without the v prefix. (e.g. 1.0.0 instead of v1.0.0) */ async function getVersionName(): Promise { - const res = await fetch('https://api.github.com/repos/saber-notes/saber/releases/latest'); + // get the latest tag from GitHub (saber-notes/saber) + const res = await fetch('https://api.github.com/repos/saber-notes/saber/tags'); const json = await res.json(); - const versionWithV = json.tag_name; + const versionWithV = json[0].name; assert(versionWithV.startsWith('v')); const versionWithoutV = versionWithV.slice(1); return versionWithoutV;