diff --git a/internal/match/match_test.go b/internal/match/match_test.go index 0c477bf..0c4d888 100644 --- a/internal/match/match_test.go +++ b/internal/match/match_test.go @@ -30,7 +30,7 @@ func TestFunc(t *testing.T) { match: true, matcher: Func([]string{"spaceghost/*", "octocat/*"}, []string{"push"}, true), }, - // repoisitory matching + // repository matching { repo: "octocat/hello-world", event: "pull_request", @@ -38,6 +38,14 @@ func TestFunc(t *testing.T) { match: true, matcher: Func([]string{"spaceghost/*", "octocat/*"}, []string{}, false), }, + // repository matching, skipping an org + { + repo: "octocat/hello-world", + event: "pull_request", + trusted: false, + match: true, + matcher: Func([]string{"!spaceghost/*", "octocat/*"}, []string{}, false), + }, // event matching { repo: "octocat/hello-world", @@ -67,6 +75,22 @@ func TestFunc(t *testing.T) { match: false, matcher: Func([]string{"octocat/*"}, []string{}, false), }, + // repository matching, skip all repos in the org + { + repo: "spaceghost/hello-world", + event: "pull_request", + trusted: false, + match: false, + matcher: Func([]string{"!spaceghost/*"}, []string{}, false), + }, + // repository matching, skip a concrete repo + { + repo: "spaceghost/hello-world", + event: "pull_request", + trusted: false, + match: false, + matcher: Func([]string{"!spaceghost/hello-world"}, []string{}, false), + }, // event matching { repo: "octocat/hello-world",