Skip to content

Commit 5b3569f

Browse files
committed
Don't break project into folders if we are running scans which don't need sca
Fix
1 parent d170e3e commit 5b3569f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

commands/audit/audit.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,22 @@ func getTargetResultsToCompare(cmdResults, resultsToCompare *results.SecurityCom
470470
return
471471
}
472472

473+
func scaIndependentScans(scans []utils.SubScanType) bool {
474+
for _, scan_type := range scans {
475+
if (scan_type != utils.SecretsScan && scan_type != utils.SastScan && scan_type != utils.IacScan) {
476+
return false
477+
}
478+
}
479+
return true
480+
}
481+
473482
func detectScanTargets(cmdResults *results.SecurityCommandResults, params *AuditParams) {
483+
484+
if scaIndependentScans(params.ScansToPerform()) {
485+
cmdResults.NewScanResults(results.ScanTarget{Target: params.workingDirs[0]})
486+
return
487+
}
488+
474489
for _, requestedDirectory := range params.workingDirs {
475490
if !fileutils.IsPathExists(requestedDirectory, false) {
476491
log.Warn("The working directory", requestedDirectory, "doesn't exist. Skipping SCA scan...")

0 commit comments

Comments
 (0)