Skip to content

Commit 318ea32

Browse files
Address review comment
1. Fail if gh release is not found
1 parent 9478884 commit 318ea32

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

scripts/release/kubectl_mongodb/promote_kubectl_plugin.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,15 @@ def upload_assets_to_github_release(asset_paths: list[str], release_version: str
290290
for r in repo.get_releases():
291291
if r.tag_name == release_version:
292292
gh_release = r
293+
break
294+
295+
if gh_release is None:
296+
logger.error(
297+
f"Could not find release (published or draft) with tag '{release_version}'. Please ensure the release exists."
298+
)
299+
sys.exit(2)
293300
except GithubException as e:
294-
logger.debug(
295-
f"ERROR: Could not find release with tag '{release_version}'. Please ensure release exists already. Error: {e}"
296-
)
301+
logger.debug(f"Failed to retrieve releases from the repository {GITHUB_REPO}. Error: {e}")
297302
sys.exit(2)
298303

299304
for asset_path in asset_paths:

0 commit comments

Comments
 (0)