Skip to content

Conversation

@codeon
Copy link
Contributor

@codeon codeon commented Sep 5, 2025

Continue if file name is not mentioned in the trufflehog results

in flow - the trufflehog check seems to be breaking with the following error-

{"level":"info-0","ts":"2025-09-05T11:12:04Z","logger":"trufflehog","msg":"finished scanning","chunks":423,"bytes":3885954,"verified_secrets":0,"unverified_secrets":1,"scan_duration":"327.499039ms","trufflehog_version":"3.90.6","verification_caching":{"Hits":0,"Misses":2,"HitsWasted":0,"AttemptsSaved":0,"VerificationTimeSpentMS":169}}
{"SourceMetadata":{"Data":{"Git":{"commit":"d8626caefdd7c646c6db0022d8d24a6cbc510462","email":"Madhav Sikka \[email protected]\u003e","repository":"https://github.com/devrev/flow","timestamp":"2025-09-05 09:49:09 +0000","line":3,"repository_local_path":"/tmp/"}}},"SourceID":1,"SourceType":16,"SourceName":"trufflehog - git","DetectorType":8,"DetectorName":"Github","DetectorDescription":"GitHub is a web-based platform used for version control and collaborative software development. GitHub tokens can be used to access and modify repositories and other resources.","DecoderName":"PLAIN","Verified":false,"VerificationFromCache":false,"Raw":"6a8e4aa74f3a4ef919107d59184d7a9ccad0d148","RawV2":"","Redacted":"","ExtraData":{"rotation_guide":"https://howtorotate.com/docs/tutorials/github/","version":"1"},"StructuredData":null}
Traceback (most recent call last):
  File "/home/runner/work/flow/flow/.global-checks-tooling/checks/check_trufflehog.py", line 80, in <module>
    check_trufflehog(json_path)
  File "/home/runner/work/flow/flow/.global-checks-tooling/checks/check_trufflehog.py", line 64, in check_trufflehog
    fn = git_info["file"]
         ~~~~~~~~^^^^^^^^
KeyError: 'file'

Example run -- https://github.com/devrev/flow/actions/runs/17491492403/job/49682270953?pr=3110#step:7:52

Summary

In this PR, we handle the missing file name case so that the script doesnt break.

Related Issues

  • work-item: ISS-207469

Type of Change

  • Change doesn't affect products or customers
  • Bug fix (non-breaking change which fixes an issue)
  • Non-breaking change (the new functionality and code refactor do not require a migration strategy)
  • Breaking change (fix or feature that will require a migration plan for data or other services)
  • Documentation/comment update
  • Other (please describe):

Testing Procedure

Checklist

  • I used generative AI to generate this PR
  • I have self-reviewed my code for clarity and correctness
  • I have added or updated comments for complex or non-obvious logic in my code
  • I have updated relevant documentation (e.g., README, code docs)
  • My changes do not introduce new warnings or errors
  • I have added or updated tests to cover new or changed functionality
  • All tests pass locally with my changes applied

Continue if file name is not mentioned in the trufflehog results
@codeon codeon requested a review from devrev-jo as a code owner September 5, 2025 11:32
@svc-devrev
Copy link

svc-devrev commented Sep 5, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@codeon codeon closed this Sep 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants