Skip to content

Commit

Permalink
fix: check if release URL is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
femnad committed Apr 11, 2024
1 parent 9351d2e commit 74fa2f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions entity/versionlookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/<principal>/<repo>/...
if len(fields) < 5 {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

const (
version = "0.35.0"
version = "0.35.1"
)

type args struct {
Expand Down

0 comments on commit 74fa2f9

Please sign in to comment.