mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-23 02:11:01 +00:00
Fix listing Gitea repos (#2768)
This commit is contained in:
parent
52163b9a3e
commit
9d5ef117a2
1 changed files with 11 additions and 9 deletions
|
@ -259,7 +259,7 @@ func (c *Gitea) Repos(ctx context.Context, u *model.User) ([]*model.Repo, error)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return shared_utils.Paginate(func(page int) ([]*model.Repo, error) {
|
repos, err := shared_utils.Paginate(func(page int) ([]*gitea.Repository, error) {
|
||||||
repos, _, err := client.ListMyRepos(
|
repos, _, err := client.ListMyRepos(
|
||||||
gitea.ListReposOptions{
|
gitea.ListReposOptions{
|
||||||
ListOptions: gitea.ListOptions{
|
ListOptions: gitea.ListOptions{
|
||||||
|
@ -268,15 +268,17 @@ func (c *Gitea) Repos(ctx context.Context, u *model.User) ([]*model.Repo, error)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
result := make([]*model.Repo, 0, len(repos))
|
return repos, err
|
||||||
for _, repo := range repos {
|
|
||||||
if repo.Archived {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
result = append(result, toRepo(repo))
|
|
||||||
}
|
|
||||||
return result, err
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
result := make([]*model.Repo, 0, len(repos))
|
||||||
|
for _, repo := range repos {
|
||||||
|
if repo.Archived {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
result = append(result, toRepo(repo))
|
||||||
|
}
|
||||||
|
return result, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// File fetches the file from the Gitea repository and returns its contents.
|
// File fetches the file from the Gitea repository and returns its contents.
|
||||||
|
|
Loading…
Reference in a new issue