Skip to content

Commit

Permalink
dropping required access level when listing groups using the GitLab API
Browse files Browse the repository at this point in the history
This will make it possible to use project-level access tokens

Resolves: #75
Signed-off-by: Alexander Hungenberg <[email protected]>
  • Loading branch information
defreng committed Jan 21, 2021
1 parent 809a301 commit f3b72d8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions git/provider_gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ func (p *GitLabProvider) getProjects(ctx context.Context, gl *gitlab.Client, r *
if !p.IsPersonal {
groupAndSubGroups := strings.Split(r.Owner, "/")
lgo := &gitlab.ListGroupsOptions{
Search: gitlab.String(groupAndSubGroups[0]),
MinAccessLevel: gitlab.AccessLevel(gitlab.GuestPermissions),
Search: gitlab.String(groupAndSubGroups[0]),
}

groups, _, err := gl.Groups.ListGroups(lgo, gitlab.WithContext(ctx))
Expand All @@ -220,8 +219,7 @@ func (p *GitLabProvider) getProjects(ctx context.Context, gl *gitlab.Client, r *
if len(groupAndSubGroups) > 1 {
lastSubGroup := groupAndSubGroups[len(groupAndSubGroups)-1]
ldgo := &gitlab.ListDescendantGroupsOptions{
Search: gitlab.String(lastSubGroup),
MinAccessLevel: gitlab.AccessLevel(gitlab.GuestPermissions),
Search: gitlab.String(lastSubGroup),
}
subGroups, _, err := gl.Groups.ListDescendantGroups(*gid, ldgo, gitlab.WithContext(ctx))
subGroup := findGroupByName(subGroups, lastSubGroup)
Expand Down

0 comments on commit f3b72d8

Please sign in to comment.