Skip to content

Find, verify, and analyze leaked credentials

(fix) validation to ensure only one of --org or --repo is provided for Github source (#4141)

Abdul Basitf649faafce8c
diff --git a/main.go b/main.go
index c40294046..83f968fb1 100644
--- a/main.go
+++ b/main.go
@@ -734,6 +734,9 @@ func runSingleScan(ctx context.Context, cmd string, cfg engine.Config) (metrics,
if len(*githubScanOrgs) == 0 && len(*githubScanRepos) == 0 {
return scanMetrics, fmt.Errorf("invalid config: you must specify at least one organization or repository")
}
+ if len(*githubScanOrgs) > 0 && len(*githubScanRepos) > 0 {
+ return scanMetrics, fmt.Errorf("invalid config: you cannot specify both organizations and repositories at the same time")
+ }
cfg := sources.GithubConfig{
Endpoint: *githubScanEndpoint,