diff --git a/utils/utils.go b/utils/utils.go index 6531eb93..7ac28a74 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -200,7 +200,7 @@ func ReadLocalFile(location string) (string, error) { // Gets the latest stable release tags from github for a given org name and repo name(in that org) in sorted order func GetLatestReleaseTagsSorted(org string, repo string) ([]string, error) { - var url string = "https://github.com/" + org + "/" + repo + "/releases" + var url string = "https://api.github.com/repos/" + org + "/" + repo + "/releases" resp, err := http.Get(url) if err != nil { return nil, ErrGettingLatestReleaseTag(err) @@ -236,3 +236,12 @@ func safeClose(co io.Closer) { log.Error(cerr) } } + +func Contains[G []K, K comparable](slice G, ele K) bool { + for _, item := range slice { + if item == ele { + return true + } + } + return false +}