(fix) validation to ensure only one of --org or --repo is provided for Github source (#4141)
* validation to ensure only one of --org or --repo is provided fro github source * position swap of variables. updated the message.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user