( release: GithubRelease, assetName: string, )
| 58 | } |
| 59 | |
| 60 | function findGithubAsset( |
| 61 | release: GithubRelease, |
| 62 | assetName: string, |
| 63 | ): GithubReleaseAsset { |
| 64 | const asset = release.assets?.find(candidate => candidate.name === assetName) |
| 65 | if (!asset?.browser_download_url) { |
| 66 | throw new Error( |
| 67 | `GitHub release ${release.tag_name ?? 'unknown'} is missing asset ${assetName}`, |
| 68 | ) |
| 69 | } |
| 70 | return asset |
| 71 | } |
| 72 | |
| 73 | async function getGithubReleaseByTag(version: string): Promise<GithubRelease> { |
| 74 | const tag = normalizeVersionTag(version) |
no outgoing calls
no test coverage detected