Skip to content

Commit

Permalink
Fix a case where an asset can be null
Browse files Browse the repository at this point in the history
  • Loading branch information
lavoiesl committed Nov 5, 2020
1 parent e46d6bd commit beccea4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function run() {
console.log(`Upload URL: ${url}`)

const { data: assets } = await octokit.repos.listAssetsForRelease({owner, repo, release_id})
assets.forEach(({ id: asset_id, name: asset_name }) => {
assets.filter(asset => asset).forEach(({ id: asset_id, name: asset_name }) => {
if (asset_name == name) {
octokit.repos.deleteReleaseAsset({owner, repo, asset_id})
}
Expand Down

0 comments on commit beccea4

Please sign in to comment.