From 74fa2f96bf6e8952227a7139d19d4f1c4b30bd20 Mon Sep 17 00:00:00 2001 From: fcd <1352288+femnad@users.noreply.github.com> Date: Thu, 11 Apr 2024 23:38:03 +0100 Subject: [PATCH] fix: check if release URL is empty --- entity/versionlookup.go | 4 ++++ main.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/entity/versionlookup.go b/entity/versionlookup.go index c8f7b0c..b3346be 100644 --- a/entity/versionlookup.go +++ b/entity/versionlookup.go @@ -105,6 +105,10 @@ func resolveQuery(spec VersionLookupSpec) (string, error) { func getRepo(spec VersionLookupSpec, releaseURL string) (string, error) { repo := spec.GithubRepo if repo == "" { + if releaseURL == "" { + return "", fmt.Errorf("need a release URL for determining GitHub repo without explicity repo config") + } + fields := strings.Split(releaseURL, "/") // URL should have the format: https://github.com///... if len(fields) < 5 { diff --git a/main.go b/main.go index 741c53f..550df16 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,7 @@ import ( ) const ( - version = "0.35.0" + version = "0.35.1" ) type args struct {