From f4f5cbfcd2a464461953fdc13af81adfc1e16d7a Mon Sep 17 00:00:00 2001 From: Kapil Garg Date: Fri, 5 Sep 2025 17:00:33 +0530 Subject: [PATCH] Update check_trufflehog.py Continue if file name is not mentioned in the trufflehog results --- checks/check_trufflehog.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/checks/check_trufflehog.py b/checks/check_trufflehog.py index 2c2e362..5f6e056 100644 --- a/checks/check_trufflehog.py +++ b/checks/check_trufflehog.py @@ -61,7 +61,9 @@ def check_trufflehog(json_path): continue finding = json.loads(line) git_info = finding["SourceMetadata"]["Data"]["Git"] - fn = git_info["file"] + fn = git_info.get("file") + if fn is None: + continue line_num = git_info["line"] if is_overridden(fn, line_num, cred_overrides): print(f"Skipping {fn}:{line_num} because it is in the creds.yml file")