perf(trufflehog): single process for PR changed-file scan#151
Merged
isaiah-grafana merged 4 commits intomainfrom Apr 15, 2026
Merged
perf(trufflehog): single process for PR changed-file scan#151isaiah-grafana merged 4 commits intomainfrom
isaiah-grafana merged 4 commits intomainfrom
Conversation
1268959 to
acb2704
Compare
ezebunandu
reviewed
Apr 14, 2026
Feed filtered paths through GNU xargs -0 so a typical PR runs one TruffleHog process (avoids per-file startup) while argv stays under OS limits on very large diffs. Paths are still filtered for excludes and missing files (e.g. deletions in the diff).
acb2704 to
f2f56c5
Compare
kelnage
requested changes
Apr 15, 2026
Contributor
kelnage
left a comment
There was a problem hiding this comment.
Two comments to consider
| if ((${#paths[@]} > 0)); then | ||
| echo "TruffleHog: ${#paths[@]} path(s), batched by xargs as needed" | ||
| : > results.ndjson | ||
| printf '%s\0' "${paths[@]}" | xargs -0 -r trufflehog filesystem \ |
Contributor
There was a problem hiding this comment.
Doesn't --include-paths=<FILE> achieve this without needing to worry about the size of the path file?
Contributor
Author
There was a problem hiding this comment.
Yep, I just modified it to use --include-paths with a temp file (anchored regex per changed path after excludes) and a single trufflehog filesystem . run, so we’re not putting paths on the argv.
Use one trufflehog filesystem invocation over . with --include-paths (anchored re.escape per path) to avoid argv limits; addresses review. Revert get-vault-secrets action pin to match main (f1614b2). Made-with: Cursor
…set testing Made-with: Cursor
Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Run one trufflehog filesystem over all filtered changed paths for pull_request / merge_group instead of one process per file, avoiding repeated startup cost on large diffs.