Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix getrelease func #349

Merged
merged 2 commits into from
Aug 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}
Loading