(resp: { status: number; data: any })
| 422 | }; |
| 423 | |
| 424 | const handleUploadedAsset = async (resp: { status: number; data: any }) => { |
| 425 | const json = resp.data; |
| 426 | if (resp.status !== 201) { |
| 427 | throw new Error( |
| 428 | `Failed to upload release asset ${name}. received status code ${ |
| 429 | resp.status |
| 430 | }\n${json.message}\n${JSON.stringify(json.errors)}`, |
| 431 | ); |
| 432 | } |
| 433 | const assetWithLabel = await maybeRestoreAssetLabel(json); |
| 434 | console.log(`✅ Uploaded ${name}`); |
| 435 | return assetWithLabel; |
| 436 | }; |
| 437 | |
| 438 | try { |
| 439 | return await handleUploadedAsset(await uploadAsset()); |
no test coverage detected