Skip to content

Commit 79fae42

Browse files
authored
fix: check if build dir contains a valid build (#135)
Signed-off-by: behnazh-w <[email protected]>
1 parent 27347f6 commit 79fae42

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/macaron/slsa_analyzer/build_tool/base_build_tool.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ def get_build_dirs(self, repo_path: str) -> Iterable[Path]:
148148
"""
149149
config_paths: set[str] = set()
150150
for build_cfg in self.build_configs:
151-
config_paths.update(glob.glob(os.path.join(repo_path, "**", build_cfg), recursive=True))
151+
config_paths.update(
152+
path
153+
for path in glob.glob(os.path.join(repo_path, "**", build_cfg), recursive=True)
154+
if self.is_detected(str(Path(path).parent))
155+
)
152156

153157
list_iter = iter(sorted(config_paths, key=lambda x: (str(Path(x).parent), len(Path(x).parts))))
154158
try:

0 commit comments

Comments
 (0)