Skip to content

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

14 linesCodeBlameRaw
1import type { DeploymentEnvironments, RepoPath, Viewer } from "@g1t/contracts";
2
3import { deployments } from "./services.server";
4
5/**
6 * A repository's environments for a sidebar's Deployments panel, or null
7 * when there are none. It throws when they cannot be read just now: the
8 * page reads it as a part (lib/partial.ts), so the panel says so in its
9 * place rather than going missing.
10 */
11export async function environmentsFor(repo: RepoPath, viewer: Viewer): Promise<DeploymentEnvironments | null> {
12 const found = await deployments.environments(repo, viewer);
13 return found.ok && found.value.environments.length > 0 ? found.value : null;
14}