(sessionContext: {
sources: SessionContextSource[]
})
| 395 | } |
| 396 | |
| 397 | export function getSessionRepoRef(sessionContext: { |
| 398 | sources: SessionContextSource[] |
| 399 | }): { owner: string; name: string } | null { |
| 400 | const gitSource = getGitSourceFromSessionContext(sessionContext) |
| 401 | if (gitSource?.url) { |
| 402 | const repoPath = parseGitHubRepository(gitSource.url) |
| 403 | if (repoPath) { |
| 404 | const [owner, name] = repoPath.split('/') |
| 405 | if (owner && name) { |
| 406 | return { owner, name } |
| 407 | } |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | const workspaceSource = |
| 412 | getNoumenaWorkspaceSourceFromSessionContext(sessionContext) |
| 413 | if (!workspaceSource) { |
| 414 | return null |
| 415 | } |
| 416 | |
| 417 | const [owner, name] = workspaceSource.repo.split('/') |
| 418 | if (!owner || !name) { |
| 419 | return null |
| 420 | } |
| 421 | |
| 422 | return { owner, name } |
| 423 | } |
| 424 | |
| 425 | export function getSessionRepoDisplay(sessionContext: { |
| 426 | sources: SessionContextSource[] |
no test coverage detected