We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e0dbbb commit d7fb511Copy full SHA for d7fb511
website/src/components/Footer/Version.astro
@@ -3,11 +3,11 @@ const { owner, repo } = Astro.props;
3
4
let latestVersion = "0.0.0";
5
try {
6
- 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`);
7
if (response.ok) {
8
const data = await response.json();
9
- if (data.length > 0) {
10
- latestVersion = data[0].name.replace(/^v/, "");
+ if (data.tag_name) {
+ latestVersion = data.tag_name;
11
}
12
13
} catch (error) {
0 commit comments