flagon-io/g1t

public

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t/apps/web/app/lib/github.server.ts

23 lines948 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look1import { env } from "cloudflare:workers";
2
3import { githubAppClient, githubSignInClient } from "@g1t/contracts";
4
Fast pages, required checks on the branch, self-hosted runners, honest incidents5import { instrumented } from "./perf.server";
6
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look7/** Signing in with GitHub, kept by the identity service. */
Fast pages, required checks on the branch, self-hosted runners, honest incidents8export const githubSignIn = githubSignInClient(instrumented("identity", env.IDENTITY));
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look9/** g1t's GitHub App: installations, imports and mirrors, kept by integrations. */
Fast pages, required checks on the branch, self-hosted runners, honest incidents10export const githubApp = githubAppClient(instrumented("integrations", env.INTEGRATIONS));
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look11
12/**
13 * Whether this g1t offers signing in with GitHub. False when no app is
14 * configured, or identity cannot say: the button is then left out.
15 */
16export async function githubSignInEnabled(): Promise<boolean> {
17 return githubSignIn.enabled().catch(() => false);
18}
19
20/** Where GitHub returns after sign-in: registered on the app, exactly. */
21export function callbackUrl(request: Request): string {
22 return `${new URL(request.url).origin}/auth/github/callback`;
23}