From 48c0c262839a4b53e736cce313d5a7812970560a Mon Sep 17 00:00:00 2001 From: vitalie Date: Thu, 6 Apr 2023 18:52:47 +0300 Subject: [PATCH] RakeTasks: refactor latest_release_for --- lib/travis/build/rake_tasks.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/travis/build/rake_tasks.rb b/lib/travis/build/rake_tasks.rb index 0d5b7715c9..291da0774b 100644 --- a/lib/travis/build/rake_tasks.rb +++ b/lib/travis/build/rake_tasks.rb @@ -58,7 +58,12 @@ def fetch_githubusercontent_file(from, host: 'raw.githubusercontent.com', end def latest_release_for(repo) - octokit.latest_release(repo)['tag_name'] + logger.info "Fetching releases from #{repo}" + + latest_release = octokit.latest_release(repo)['tag_name'] + raise "No releases found for #{repo}" if latest_release.empty? + + latest_release rescue raise "Could not get latest release for #{repo}" end