(
config: GithubConnectionConfig,
connectionId: number,
signal: AbortSignal)
| 55 | } |
| 56 | |
| 57 | export const compileGithubConfig = async ( |
| 58 | config: GithubConnectionConfig, |
| 59 | connectionId: number, |
| 60 | signal: AbortSignal): Promise<CompileResult> => { |
| 61 | const gitHubReposResult = await getGitHubReposFromConfig(config, signal); |
| 62 | const gitHubRepos = gitHubReposResult.repos; |
| 63 | const warnings = gitHubReposResult.warnings; |
| 64 | |
| 65 | const hostUrl = (config.url ?? 'https://github.com').replace(/\/+$/, ''); |
| 66 | |
| 67 | const repos = gitHubRepos.map((repo) => { |
| 68 | const record = createGitHubRepoRecord({ |
| 69 | repo, |
| 70 | hostUrl, |
| 71 | branches: config.revisions?.branches ?? undefined, |
| 72 | tags: config.revisions?.tags ?? undefined, |
| 73 | }) |
| 74 | |
| 75 | return { |
| 76 | ...record, |
| 77 | connections: { |
| 78 | create: { |
| 79 | connectionId: connectionId, |
| 80 | } |
| 81 | }, |
| 82 | }; |
| 83 | }) |
| 84 | |
| 85 | return { |
| 86 | repoData: repos, |
| 87 | warnings, |
| 88 | }; |
| 89 | } |
| 90 | |
| 91 | export const createGitHubRepoRecord = ({ |
| 92 | repo, |
no test coverage detected