(tag: string)
| 30 | * Check if a GitHub release exists for a tag. |
| 31 | */ |
| 32 | export async function releaseExists(tag: string): Promise<boolean> { |
| 33 | try { |
| 34 | await request("GET /repos/{owner}/{repo}/releases/tags/{tag}", { |
| 35 | ...requestOptions(), |
| 36 | tag, |
| 37 | }); |
| 38 | return true; |
| 39 | } catch (error) { |
| 40 | if (error instanceof Error && "status" in error && error.status === 404) { |
| 41 | return false; |
| 42 | } |
| 43 | throw error; |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Creates a GitHub release for a package version. |
no test coverage detected