mirror of
https://gitea.com/jolheiser/sip
synced 2025-02-20 00:21:46 +01:00
Clean up docs Signed-off-by: jolheiser <john.olheiser@gmail.com> Add generated docs Signed-off-by: jolheiser <john.olheiser@gmail.com> Update go.sum Signed-off-by: jolheiser <john.olheiser@gmail.com> Fix remote parsing Signed-off-by: jolheiser <john.olheiser@gmail.com> Refactor and clean up Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: jolheiser <john.olheiser@gmail.com> Reviewed-on: https://gitea.com/jolheiser/sip/pulls/29
24 lines
514 B
Go
24 lines
514 B
Go
package sdk
|
|
|
|
import "code.gitea.io/sdk/gitea"
|
|
|
|
// GetReleases returns all matching Releases from a Gitea instance
|
|
func GetReleases(client *gitea.Client, owner, repo string, opts gitea.ListReleasesOptions) ([]*gitea.Release, error) {
|
|
releases := make([]*gitea.Release, 0)
|
|
p := 1
|
|
for {
|
|
opts.Page = p
|
|
list, _, err := client.ListReleases(owner, repo, opts)
|
|
if err != nil {
|
|
return releases, err
|
|
}
|
|
p++
|
|
releases = append(releases, list...)
|
|
|
|
if len(list) == 0 {
|
|
break
|
|
}
|
|
}
|
|
return releases, nil
|
|
}
|