Skip to content

Commit 19e0834

Browse files
committed
refactor(code): use latest tag
1 parent b135365 commit 19e0834

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/components/Code.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface Props extends ExpressiveCodeBlockProps
99
}
1010
1111
const response = await fetch(
12-
"https://api.github.com/repos/saucer/saucer/releases/latest",
12+
"https://api.github.com/repos/saucer/saucer/tags",
1313
{
1414
headers: [
1515
["Accept", "application/vnd.github+json"],
@@ -19,7 +19,7 @@ const response = await fetch(
1919
);
2020
2121
const parsed = await response.json();
22-
const version = parsed["tag_name"] ?? "v7.0.0";
22+
const version = parsed?.[0]?.["name"] ?? "v7.0.0";
2323
2424
const { code, lang, ...props } = Astro.props;
2525
const versionedCode = code.replace("$VERSION$", version);

0 commit comments

Comments
 (0)