diff options
| author | Jay V <[email protected]> | 2025-11-03 18:03:10 -0500 |
|---|---|---|
| committer | Jay V <[email protected]> | 2025-11-03 18:17:32 -0500 |
| commit | d06afd87e5a0325730b11478eb49af4ced12608a (patch) | |
| tree | 97555b444fac7e289063a3bcded796a9cfc8db0b /packages/console/app/src/lib | |
| parent | 9fb6e81007ad000e5e55255af7e12a6c6fb58bde (diff) | |
| download | opencode-d06afd87e5a0325730b11478eb49af4ced12608a.tar.gz opencode-d06afd87e5a0325730b11478eb49af4ced12608a.zip | |
ignore: lander
Diffstat (limited to 'packages/console/app/src/lib')
| -rw-r--r-- | packages/console/app/src/lib/github.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/console/app/src/lib/github.ts b/packages/console/app/src/lib/github.ts index 5f742aef6..dab317751 100644 --- a/packages/console/app/src/lib/github.ts +++ b/packages/console/app/src/lib/github.ts @@ -1,4 +1,5 @@ import { query } from "@solidjs/router" +import { config } from "~/config" export const github = query(async () => { "use server" @@ -6,11 +7,15 @@ export const github = query(async () => { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36", } + const apiBaseUrl = config.github.repoUrl.replace( + "https://github.com/", + "https://api.github.com/repos/", + ) try { const [meta, releases, contributors] = await Promise.all([ - fetch("https://api.github.com/repos/sst/opencode", { headers }).then((res) => res.json()), - fetch("https://api.github.com/repos/sst/opencode/releases", { headers }).then((res) => res.json()), - fetch("https://api.github.com/repos/sst/opencode/contributors?per_page=1", { headers }), + fetch(apiBaseUrl, { headers }).then((res) => res.json()), + fetch(`${apiBaseUrl}/releases`, { headers }).then((res) => res.json()), + fetch(`${apiBaseUrl}/contributors?per_page=1`, { headers }), ]) const [release] = releases const contributorCount = Number.parseInt( |
