Skip to content

Commit

Permalink
fix(website): handle GitHub release version correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Sep 11, 2024
1 parent 7e0dbbb commit d7fb511
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions website/src/components/Footer/Version.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ const { owner, repo } = Astro.props;
let latestVersion = "0.0.0";
try {
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}/releases`);
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}/releases/latest`);
if (response.ok) {
const data = await response.json();
if (data.length > 0) {
latestVersion = data[0].name.replace(/^v/, "");
if (data.tag_name) {
latestVersion = data.tag_name;
}
}
} catch (error) {
Expand Down

0 comments on commit d7fb511

Please sign in to comment.