diff --git a/entrypoint.py b/entrypoint.py index 463808d..5380753 100644 --- a/entrypoint.py +++ b/entrypoint.py @@ -110,6 +110,18 @@ def annotate_pr(message: str) -> None: if f.endswith(extension_filter) ] + if not files: + if extension_filter: + print( + f"Error: {case_path} is a directory but no files matched " + f"extension filter {extension_filter!r}." + ) + else: + print( + f"Error: {case_path} is a directory but it contains no files to validate." + ) + sys.exit(1) + print(f"Validating {len(files)} files at: {case_path}") # Loop through each file and validate it has_failure: bool = False