Skip to content

Commit

Permalink
fix: use latest tag not release
Browse files Browse the repository at this point in the history
Release hasn't been made when the action is called by repository dispatch
  • Loading branch information
adil192 committed Dec 2, 2023
1 parent 8939a72 commit 0655270
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> {
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;
Expand Down

0 comments on commit 0655270

Please sign in to comment.