feat(github): support per-workspace GitHub App registrations (#1810)

This commit is contained in:
Carlos Florêncio
2026-07-26 10:39:08 +01:00
committed by GitHub
parent bc218dfbbe
commit 75abf779ed
347 changed files with 36471 additions and 2896 deletions
@@ -1,5 +1,6 @@
import { GitHubIntegrationPage } from "@/components/github/github-settings";
import { StateHydrator } from "@/components/state-hydrator";
import { normalizeGitHubStatus } from "@/hooks/domains/github/use-github-status";
import { fetchGitHubStatus } from "@/lib/api/domains/github-api";
type IntegrationsGitHubPageProps = {
@@ -9,16 +10,24 @@ type IntegrationsGitHubPageProps = {
export default async function IntegrationsGitHubPage({
workspaceId,
}: IntegrationsGitHubPageProps = {}) {
const status = await fetchGitHubStatus({ cache: "no-store" }).catch(() => null);
const initialState = status
? {
githubStatus: {
status,
loaded: true,
loading: false,
},
}
: {};
const status = workspaceId
? await fetchGitHubStatus(workspaceId, { cache: "no-store" }).catch(() => null)
: null;
const statusWorkspaceId = workspaceId ?? status?.workspace_id;
const initialState =
status && statusWorkspaceId
? {
githubStatus: {
byWorkspaceId: {
[statusWorkspaceId]: {
status: normalizeGitHubStatus(status),
loaded: true,
loading: false,
},
},
},
}
: {};
return (
<>
<StateHydrator initialState={initialState} />