Skip to content

Commit d7fb511

Browse files
committed
fix(website): handle GitHub release version correctly
1 parent 7e0dbbb commit d7fb511

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

website/src/components/Footer/Version.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ const { owner, repo } = Astro.props;
33
44
let latestVersion = "0.0.0";
55
try {
6-
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}/releases`);
6+
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}/releases/latest`);
77
if (response.ok) {
88
const data = await response.json();
9-
if (data.length > 0) {
10-
latestVersion = data[0].name.replace(/^v/, "");
9+
if (data.tag_name) {
10+
latestVersion = data.tag_name;
1111
}
1212
}
1313
} catch (error) {

0 commit comments

Comments
 (0)