From 8d5e36909a4ee541bf855461c156c73c5fc937aa Mon Sep 17 00:00:00 2001 From: behnazh-w Date: Thu, 30 Mar 2023 14:14:29 +1000 Subject: [PATCH] fix: check if build dir contains a valid build Signed-off-by: behnazh-w --- src/macaron/slsa_analyzer/build_tool/base_build_tool.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/macaron/slsa_analyzer/build_tool/base_build_tool.py b/src/macaron/slsa_analyzer/build_tool/base_build_tool.py index 29357d627..81fc728a8 100644 --- a/src/macaron/slsa_analyzer/build_tool/base_build_tool.py +++ b/src/macaron/slsa_analyzer/build_tool/base_build_tool.py @@ -148,7 +148,11 @@ def get_build_dirs(self, repo_path: str) -> Iterable[Path]: """ config_paths: set[str] = set() for build_cfg in self.build_configs: - config_paths.update(glob.glob(os.path.join(repo_path, "**", build_cfg), recursive=True)) + config_paths.update( + path + for path in glob.glob(os.path.join(repo_path, "**", build_cfg), recursive=True) + if self.is_detected(str(Path(path).parent)) + ) list_iter = iter(sorted(config_paths, key=lambda x: (str(Path(x).parent), len(Path(x).parts)))) try: