diff --git a/spinner.gif b/spinner.gif new file mode 100644 index 0000000..c918540 Binary files /dev/null and b/spinner.gif differ diff --git a/src/github/api/config.ts b/src/github/api/config.ts index 3c01775..4737c1e 100644 --- a/src/github/api/config.ts +++ b/src/github/api/config.ts @@ -1,4 +1,14 @@ export const GITEA_API_URL = process.env.GITEA_API_URL || "https://api.github.com"; + +// Derive server URL from API URL for Gitea instances +function deriveServerUrl(apiUrl: string): string { + if (apiUrl.includes("api.github.com")) { + return "https://github.com"; + } + // For Gitea, remove /api/v1 from the API URL to get the server URL + return apiUrl.replace(/\/api\/v1\/?$/, ""); +} + export const GITEA_SERVER_URL = - process.env.GITEA_SERVER_URL || "https://github.com"; + process.env.GITEA_SERVER_URL || deriveServerUrl(GITEA_API_URL);