fix for all branches being scanned if cxflow.branches is empty even if branches are present in config-as-code
@@ -72,10 +72,6 @@ public class HelperService {
}
}
- if (CollectionUtils.isEmpty(branches)) {
- return true;
- }
-
// Override branches if provided in the request
if (CollectionUtils.isNotEmpty(request.getActiveBranches())) {
branches = request.getActiveBranches();
@@ -86,6 +82,10 @@ public class HelperService {
return true;
}
+ if (CollectionUtils.isEmpty(branches)) {
+ return true;
+ }
+
log.info("Branch {} did not meet the scanning criteria [{}]", branchToCheck, branches);
return false;
}
