MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / getGitHubRepositoryReference

Function getGitHubRepositoryReference

apps/web/src/lib/bot/platforms/github.ts:39–54  ·  view source on GitHub ↗
(
  thread: Thread,
  message: Message
)

Source from the content-addressed store, hash-verified

37function parseGitHubRepositoryFullName(id: string | undefined): string | null {
38 if (!id) return null;
39
40 const match = id.match(/^github:([^/]+\/[^:]+)(?::|$)/);
41 if (!match) return null;
42
43 return match[1] ?? null;
44}
45
46export function getGitHubRepositoryReference(
47 thread: Thread,
48 message?: Message
49): GitHubRepositoryReference {
50 const { repository } = (message as Message<Partial<GitHubRawMessage>> | undefined)?.raw ?? {};
51
52 return {
53 id: repository?.id ?? null,
54 fullName:
55 repository?.full_name ??
56 parseGitHubRepositoryFullName(thread.id) ??
57 parseGitHubRepositoryFullName(thread.channelId),

Callers 2

github.test.tsFile · 0.90
canHandleMessageFunction · 0.85

Calls 1

Tested by

no test coverage detected