Fail the secret scanning job when the scan errors out - #6758
Open
albertvillanova wants to merge 1 commit into
Open
Fail the secret scanning job when the scan errors out#6758albertvillanova wants to merge 1 commit into
albertvillanova wants to merge 1 commit into
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
This was referenced Aug 14, 2026
Member
Author
|
Reported the upstream case that motivates this flag: Their |
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.
Stacked on top of #6757.
This PR makes the secret scanning job fail when the scan itself errors out, instead of reporting success.
Motivation
The scanner exits 0 when it cannot scan. If it fails to resolve the commit range it was handed, it logs an error, reports
"chunks": 0, "bytes": 0, and the job goes green:That is not hypothetical. The same workflow in
huggingface/transformershas been in exactly this state since huggingface/transformers#47945, where every pull request branch and every merge queue push scans zero bytes and passes:fix_qwen2_5_vl_batch_wo_imageserge/fix/itf-...gh-readonly-queue/main/pr-47960-...A secret scan that covers nothing is worse than one that fails, because a green check invites nobody to look.
Solution
Pass
--fail-on-scan-errors, so the job fails closed on scan errors. Verified against the pinned scanner image:The flag covers source and chunking errors only, so results whose verification errored are still reported through
--results=verified,unknownexactly as before.Changes
--fail-on-scan-errorsto the scanner arguments, with a comment recording whyNote
Low Risk
CI-only workflow tweak that tightens secret-scan reliability; no application or auth logic changes, with possible extra failures on genuine scan errors.
Overview
The TruffleHog workflow now passes
--fail-on-scan-errorsinextra_args, so the secret scanning job fails when the scanner hits source/chunking errors (e.g. unresolvable commit range) instead of exiting successfully with zero bytes scanned.A short comment in
.github/workflows/trufflehog.ymldocuments that behavior. Existing flags (--results=verified,unknown, detector exclusions) are unchanged.Reviewed by Cursor Bugbot for commit 5dc4139. Bugbot is set up for automated code reviews on this repo. Configure here.