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

Do not list archived repos for all forges #2374

Merged
merged 4 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions server/forge/gitea/gitea.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ func (c *Gitea) Repos(ctx context.Context, u *model.User) ([]*model.Repo, error)
)
result := make([]*model.Repo, 0, len(repos))
for _, repo := range repos {
if repo.Archived == true {
qwerty287 marked this conversation as resolved.
Show resolved Hide resolved
continue
}
result = append(result, toRepo(repo))
}
return result, err
Expand Down
7 changes: 6 additions & 1 deletion server/forge/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,12 @@ func (c *client) Repos(ctx context.Context, u *model.User) ([]*model.Repo, error
if err != nil {
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
}
return repos, nil
Expand Down
1 change: 1 addition & 0 deletions server/forge/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func New(opts Opts) (forge.Forge, error) {
ClientID: opts.ClientID,
ClientSecret: opts.ClientSecret,
SkipVerify: opts.SkipVerify,
HideArchives: true,
}, nil
}

Expand Down