From 820db8e43f16f9e74360e464f25bba777d8b4a68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Carretero?= Date: Tue, 30 Jun 2020 22:29:46 -0400 Subject: [PATCH] release_github: fixup logic --- distriploy/release_github.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/distriploy/release_github.py b/distriploy/release_github.py index e0e4b55..d691753 100644 --- a/distriploy/release_github.py +++ b/distriploy/release_github.py @@ -43,10 +43,10 @@ def release(repo_path, revision, cfg_root) -> dict: local_path = download_default_release_asset(github_repo, release_id, github_token, tmpdir) ret["artifact_path"] = local_path - if not releases[release_id]["assets"]: - url = upload_release_asset(github_repo, release_id, local_path, github_token) - else: + if release_id in releases and releases[release_id]["assets"]: url = releases[release_id]["assets"][0]["browser_download_url"] + else: + url = upload_release_asset(github_repo, release_id, local_path, github_token) ret["artifact_url"] = url