Skip to content

Commit

Permalink
Merge pull request #8 from Shopify/seb-fix-null
Browse files Browse the repository at this point in the history
Fix a case where an asset can be null
  • Loading branch information
lavoiesl authored Nov 5, 2020
2 parents 5bf87c2 + beccea4 commit 9942a4c
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 9942a4c

Please sign in to comment.