Skip to content

Commit e9cc178

Browse files
committed
Add wildcard exclusion for organisation or user
1 parent 3952bae commit e9cc178

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

github.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,16 @@ func (c *GithubConfig) ListRepositories() ([]*Repository, error) {
5151
gitUrl.User = url.UserPassword("github", c.AccessToken)
5252

5353
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+
repoOwner = *repo.FullName[:strings.Index(*repo.FullName, "/")]
63+
return strings.EqualFold(s, repoOwner)
5564
})
5665
if isExcluded {
5766
log.Printf("Skipping excluded repository: %s", *repo.FullName)

0 commit comments

Comments
 (0)