Skip to content

Commit

Permalink
avoid failing if release does not have any assets associated with it
Browse files Browse the repository at this point in the history
  • Loading branch information
darora committed Sep 20, 2021
1 parent 24060e3 commit 1bf4f09
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ def output(release):
print('::set-output name=release::{}'.format(release.tag_name))
print('::set-output name=release_id::{}'.format(release.id))
assets = release.get_assets()
print('::set-output name=browser_download_url::{}'.format(assets[0].browser_download_url))
dl_url = assets[0].browser_download_url if len(assets) > 0 else '""'
print('::set-output name=browser_download_url::{}'.format(dl_url))


# Releases parsing
for release in releases:
Expand All @@ -38,4 +40,4 @@ def output(release):
output(release)
break
else:
print('Cant get release')
print('Can\'t get release')

0 comments on commit 1bf4f09

Please sign in to comment.