File tree Expand file tree Collapse file tree 3 files changed +32
-4
lines changed Expand file tree Collapse file tree 3 files changed +32
-4
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,10 @@ github:
40
40
# (default: https://api.github.com)
41
41
url : https://github.mydomain.com
42
42
# (optional) Exclude this list of repos
43
- excluded :
43
+ # or whole organizations/users
44
+ exclude :
45
+ - my-excluded-org
46
+ - my-excluded-user
44
47
- my-namespace/excluded-repository-name
45
48
# The gitlab section contains backup jobs for
46
49
# GitLab.com and GitLab on premise
@@ -68,7 +71,10 @@ gitlab:
68
71
# (default: https://gitlab.com/)
69
72
url : https://gitlab.mydomain.com
70
73
# (optional) Exclude this list of repos
71
- excluded :
74
+ # or whole organizations/users
75
+ exclude :
76
+ - my-excluded-org
77
+ - my-excluded-user
72
78
- my-namespace/excluded-repository-name
73
79
` ` `
74
80
Original file line number Diff line number Diff line change @@ -51,7 +51,18 @@ func (c *GithubConfig) ListRepositories() ([]*Repository, error) {
51
51
gitUrl .User = url .UserPassword ("github" , c .AccessToken )
52
52
53
53
isExcluded := slices .ContainsFunc (c .Exclude , func (s string ) bool {
54
- return strings .EqualFold (s , * repo .FullName )
54
+ if strings .EqualFold (s , * repo .FullName ) {
55
+ return true
56
+ }
57
+
58
+ if strings .Contains (s , "/" ) {
59
+ return false
60
+ }
61
+
62
+ repoFullName := * repo .FullName
63
+
64
+ repoOwner := repoFullName [:strings .Index (repoFullName , "/" )]
65
+ return strings .EqualFold (s , repoOwner )
55
66
})
56
67
if isExcluded {
57
68
log .Printf ("Skipping excluded repository: %s" , * repo .FullName )
Original file line number Diff line number Diff line change @@ -69,7 +69,18 @@ func (g *GitLabConfig) ListRepositories() ([]*Repository, error) {
69
69
outSlice := make ([]* Repository , 0 , len (out ))
70
70
for _ , repository := range out {
71
71
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 )
73
84
})
74
85
if isExcluded {
75
86
log .Printf ("Skipping excluded repository: %s" , repository .FullName )
You can’t perform that action at this time.
0 commit comments