Skip to content

Commit 7984f29

Browse files
committed
💄
1 parent 3070a32 commit 7984f29

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/publicApi.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,9 @@ export function rawWorkspaceToWorkspaceData(rawWorkspaces: Workspace): Workspace
307307
export function rawWorkspaceToWorkspaceData(rawWorkspaces: Workspace[]): WorkspaceData[];
308308
export function rawWorkspaceToWorkspaceData(rawWorkspaces: Workspace | Workspace[]) {
309309
const toWorkspaceData = (ws: Workspace) => {
310-
const contextUrl = ws.context?.details.case === 'git' ? ws.context.details.value.normalizedContextUrl : ws.context.contextUrl;
310+
// https://github.com/gitpod-io/gitpod/blob/7e0c605a3d470b8cee0e841e51da9b20022f4f4b/components/public-api-server/pkg/apiv1/workspace.go#L332-L335
311+
// it's always git context, safe to go
312+
const contextUrl = ws.context?.details.case === 'git' ? ws.context.details.value.normalizedContextUrl : ws.context!.contextUrl;
311313
const url = new URL(contextUrl);
312314
const provider = url.host.replace(/\..+?$/, ''); // remove '.com', etc
313315
const matches = url.pathname.match(/[^/]+/g)!; // match /owner/repo

0 commit comments

Comments
 (0)