Skip to content
This repository was archived by the owner on Jan 23, 2022. It is now read-only.

Commit 52da193

Browse files
committed
fix search projects
1 parent f38a14f commit 52da193

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

scm/driver/gitlab/gitlab.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func New(uri string) (*scm.Client, error) {
3636
client.Organizations = &organizationService{client}
3737
client.PullRequests = &pullService{client}
3838
client.Repositories = &repositoryService{client}
39+
client.SearchService = &searchService{client}
3940
client.Reviews = &reviewService{client}
4041
client.Users = &userService{client}
4142
client.Webhooks = &webhookService{client}

scm/driver/gitlab/search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type searchService struct {
1616
}
1717

1818
func (s *searchService) FindProjects(ctx context.Context, projectName string) ([]*scm.Repository, *scm.Response, error) {
19-
path := fmt.Sprintf("api/v4/projects/%s", encode(projectName))
19+
path := fmt.Sprintf("api/v4/search?scope=projects&search=%s", encode(projectName))
2020
out := []*repository{}
2121
res, err := s.client.do(ctx, "GET", path, nil, out)
2222
return convertRepositoryList(out), res, err

0 commit comments

Comments
 (0)