Skip to content

Commit f649faa

Browse files
authored
(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.
1 parent bb506f6 commit f649faa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,9 @@ func runSingleScan(ctx context.Context, cmd string, cfg engine.Config) (metrics,
734734
if len(*githubScanOrgs) == 0 && len(*githubScanRepos) == 0 {
735735
return scanMetrics, fmt.Errorf("invalid config: you must specify at least one organization or repository")
736736
}
737+
if len(*githubScanOrgs) > 0 && len(*githubScanRepos) > 0 {
738+
return scanMetrics, fmt.Errorf("invalid config: you cannot specify both organizations and repositories at the same time")
739+
}
737740

738741
cfg := sources.GithubConfig{
739742
Endpoint: *githubScanEndpoint,

0 commit comments

Comments
 (0)