(repository)
| 40 | } |
| 41 | |
| 42 | function parseRepo(repository) { |
| 43 | const url = new URL(repository) |
| 44 | const [owner, name] = url.pathname.replace(/^\/|\/$/g, '').split('/') |
| 45 | |
| 46 | if (!owner || !name) { |
| 47 | throw new Error(`Unsupported repository path: ${repository}`) |
| 48 | } |
| 49 | |
| 50 | return { host: url.hostname.replace(/^www\./, ''), owner, name } |
| 51 | } |
| 52 | |
| 53 | async function readGithub({ owner, name }) { |
| 54 | const headers = githubToken ? { Authorization: `Bearer ${githubToken}` } : {} |
no outgoing calls
no test coverage detected