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

[feat]: [CDS-93606]: Fix the query param for github list repos #300

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions scm/driver/github/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func (s *RepositoryService) List(ctx context.Context, opts scm.ListOptions) ([]*
// ListV2 returns the user repository list based on the searchTerm passed.
func (s *RepositoryService) ListV2(ctx context.Context, opts scm.RepoListOptions) ([]*scm.Repository, *scm.Response, error) {
path := fmt.Sprintf("search/repositories?%s", encodeRepoListOptions(opts))
fmt.Println(path)
out := new(searchRepositoryList)
res, err := s.client.do(ctx, "GET", path, nil, &out)
return convertRepositoryList(out.Repositories), res, err
Expand Down
2 changes: 1 addition & 1 deletion scm/driver/github/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func encodeRepoListOptions(opts scm.RepoListOptions) string {
if opts.RepoSearchTerm.RepoName != "" {
sb.WriteString("q=")
sb.WriteString(opts.RepoSearchTerm.RepoName)
sb.WriteString("in:name+user:")
sb.WriteString(" in:name+user:")
sb.WriteString(opts.RepoSearchTerm.User)
} else {
sb.WriteString("q=")
Expand Down