mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-04 17:15:28 +00:00
Do not list archived repos for all forges (#2374)
Bitbucket seems that does not support repository archiving. Resolves: https://github.com/woodpecker-ci/woodpecker/issues/2235 --------- Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
85e157bb10
commit
8a517a8596
@@ -269,6 +269,9 @@ func (c *Gitea) Repos(ctx context.Context, u *model.User) ([]*model.Repo, error)
|
|||||||
)
|
)
|
||||||
result := make([]*model.Repo, 0, len(repos))
|
result := make([]*model.Repo, 0, len(repos))
|
||||||
for _, repo := range repos {
|
for _, repo := range repos {
|
||||||
|
if repo.Archived {
|
||||||
|
continue
|
||||||
|
}
|
||||||
result = append(result, toRepo(repo))
|
result = append(result, toRepo(repo))
|
||||||
}
|
}
|
||||||
return result, err
|
return result, err
|
||||||
|
@@ -209,7 +209,12 @@ func (c *client) Repos(ctx context.Context, u *model.User) ([]*model.Repo, error
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
repos = append(repos, convertRepoList(list)...)
|
for _, repo := range list {
|
||||||
|
if repo.GetArchived() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
repos = append(repos, convertRepo(repo))
|
||||||
|
}
|
||||||
opts.Page = resp.NextPage
|
opts.Page = resp.NextPage
|
||||||
}
|
}
|
||||||
return repos, nil
|
return repos, nil
|
||||||
|
@@ -70,6 +70,7 @@ func New(opts Opts) (forge.Forge, error) {
|
|||||||
ClientID: opts.ClientID,
|
ClientID: opts.ClientID,
|
||||||
ClientSecret: opts.ClientSecret,
|
ClientSecret: opts.ClientSecret,
|
||||||
SkipVerify: opts.SkipVerify,
|
SkipVerify: opts.SkipVerify,
|
||||||
|
HideArchives: true,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user