#8 delete cobra, add micro-config-flag #11

Merged
vtolstov merged 53 commits from kgorbunov/pkgdash:master into master 2024-04-02 22:54:17 +03:00
Showing only changes of commit 687acd85c7 - Show all commits

View File

@ -407,7 +407,7 @@ func GetPulls(ctx context.Context, url, owner, repo, token string) ([]*giteaPull
var pullsAll, pulls []*giteaPull
page := 1
for page != 0 {
for {
req, err := http.NewRequestWithContext(
ctx,
http.MethodGet,
@ -427,16 +427,16 @@ func GetPulls(ctx context.Context, url, owner, repo, token string) ([]*giteaPull
buf, _ := io.ReadAll(rsp.Body)
if buf == nil {
break
}
switch rsp.StatusCode {
case http.StatusOK:
if err = json.Unmarshal(buf, &pulls); err != nil {
logger.Error(ctx, fmt.Sprintf("failed to decode response %s err: %v", buf, err))
return nil, err
}
if len(pulls) == 0 {
page = 0
break
}
pullsAll = append(pullsAll, pulls...)
page++
case http.StatusNotFound: