diff --git a/.github/scripts/release/upload-asset.js b/.github/scripts/release/upload-asset.js index 224df1156c6..98ebe7e607f 100644 --- a/.github/scripts/release/upload-asset.js +++ b/.github/scripts/release/upload-asset.js @@ -18,9 +18,9 @@ const uploadAsset = async ({ release_id }); - const foundAsset = uploadRelease?.assets?.find( - (asset) => asset.name === assetName - ); + const { assets = [] } = uploadRelease.data; + + const foundAsset = assets?.find((asset) => asset.name === assetName); if (foundAsset) { await github.rest.repos.deleteReleaseAsset({