Skip to content

Commit bb007da

Browse files
committed
Added owner exclusion to gitlab too
1 parent 4775f6c commit bb007da

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

gitlab.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,18 @@ func (g *GitLabConfig) ListRepositories() ([]*Repository, error) {
6969
outSlice := make([]*Repository, 0, len(out))
7070
for _, repository := range out {
7171
isExcluded := slices.ContainsFunc(g.Exclude, func(s string) bool {
72-
return strings.EqualFold(s, repository.FullName)
72+
if strings.EqualFold(s, repository.FullName) {
73+
return true
74+
}
75+
76+
if strings.Contains(s, "/") {
77+
return false
78+
}
79+
80+
repoFullName := repository.FullName
81+
82+
repoOwner := repoFullName[:strings.Index(repoFullName, "/")]
83+
return strings.EqualFold(s, repoOwner)
7384
})
7485
if isExcluded {
7586
log.Printf("Skipping excluded repository: %s", repository.FullName)

0 commit comments

Comments
 (0)