From 9fb4bdef310265d52e2083f4e4248072dfa5149e Mon Sep 17 00:00:00 2001 From: "luke.blackburn-bcb" Date: Mon, 15 Jul 2024 15:58:18 +0100 Subject: [PATCH 1/2] feat: also including projects in sub-groups --- pkg/projects.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/projects.go b/pkg/projects.go index 88a0dd0..8153a51 100644 --- a/pkg/projects.go +++ b/pkg/projects.go @@ -107,7 +107,7 @@ func (g *GitLabProject) GetID() (int, error) { if g.Name == "" { return 0, errors.New("insufficient information for project - name or id must be provided") } - projSearch, _, err := g.client.Groups.ListGroupProjects(g.GroupID, &gitlab.ListGroupProjectsOptions{Search: gitlab.String(g.Name)}) + projSearch, _, err := g.client.Groups.ListGroupProjects(g.GroupID, &gitlab.ListGroupProjectsOptions{Search: gitlab.String(g.Name), IncludeSubGroups: true}) if err != nil { return 0, errors.New(fmt.Sprintf("could not determine group ID: %v", err)) } From 0be5c285dd4fd22d66f203ef69296fb456d3e77e Mon Sep 17 00:00:00 2001 From: "luke.blackburn-bcb" Date: Mon, 15 Jul 2024 17:30:05 +0100 Subject: [PATCH 2/2] fix: correcting boolean syntax --- pkg/projects.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/projects.go b/pkg/projects.go index 8153a51..7e3fbf4 100644 --- a/pkg/projects.go +++ b/pkg/projects.go @@ -107,7 +107,7 @@ func (g *GitLabProject) GetID() (int, error) { if g.Name == "" { return 0, errors.New("insufficient information for project - name or id must be provided") } - projSearch, _, err := g.client.Groups.ListGroupProjects(g.GroupID, &gitlab.ListGroupProjectsOptions{Search: gitlab.String(g.Name), IncludeSubGroups: true}) + projSearch, _, err := g.client.Groups.ListGroupProjects(g.GroupID, &gitlab.ListGroupProjectsOptions{Search: gitlab.String(g.Name), IncludeSubGroups: gitlab.Bool(true)}) if err != nil { return 0, errors.New(fmt.Sprintf("could not determine group ID: %v", err)) }