Skip to content

Commit 8524ee3

Browse files
committed
Only scan recursively if SCA is requested
1 parent 059d7e7 commit 8524ee3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

commands/audit/audit.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,9 @@ func (auditCmd *AuditCommand) Run() (err error) {
182182
if len(auditCmd.workingDirs) > 1 {
183183
return errors.New("the 'audit' command with the 'Xray lib' BOM generator supports only one working directory. Please provide a single working directory")
184184
}
185-
} else {
186-
// If no workingDirs were provided by the user, we apply a recursive scan on the root repository
185+
} else if utils.IsScanRequested(utils.SourceCode, utils.ScaScan, auditCmd.ScansToPerform()...) || auditCmd.IncludeSbom {
186+
// Only in case of SCA scan / SBOM requested and if no workingDirs were provided by the user
187+
// We apply a recursive scan on the root repository
187188
isRecursiveScan = len(auditCmd.workingDirs) == 0
188189
}
189190
workingDirs, err := coreutils.GetFullPathsWorkingDirs(auditCmd.workingDirs)

0 commit comments

Comments
 (0)