fix(ci): let TruffleHog derive its own scan range - #485
Open
alanhwu wants to merge 1 commit into
Open
Conversation
The workflow pinned base to the default branch and head to HEAD. On a push to main both resolve to the same commit, and the action treats that as a hard error: ::error::BASE and HEAD commits are the same. TruffleHog won't scan anything. continue-on-error swallowed it, then the Scan Results Status step re-raised it as exit 1 — so every push to main went red without a single commit ever being scanned. 38 consecutive failures on main since April; no successful run on main in the workflow's history. The action already derives the correct range per event when base and head are left empty: github.event.before..github.event.after on push, and pull_request.base.sha..pull_request.head.sha on pull_request. Dropping both inputs leaves PR behavior byte-for-byte identical and makes pushes to main scan the range that was actually pushed. Note this file came from the org's infra template with these inputs already set, so other Uniswap repos seeded from it are likely red on main for the same reason and the fix probably belongs upstream too. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
What
Deletes the
baseandheadinputs from the TruffleHog step. Two lines.Why
The workflow pinned
baseto the default branch andheadtoHEAD:On a push to
mainboth resolve to the same commit. The action has an explicit guard for that case:continue-on-error: trueswallows the failure, thenScan Results Statusre-raises it asexit 1. Result: every push to main goes red without a single commit ever being scanned.38 consecutive failures on main going back to April 2026. There is no successful run on main anywhere in this workflow's history. PRs are green only because on a PR
HEAD≠main, so a real diff scan happens.The fix
The action already derives the right range per event — but only when
base/headare left empty:The
pull_requestbranch is exactly what this workflow was already getting, so PR behavior is byte-for-byte identical. Pushes to main start scanning the range that was actually pushed. The all-zeros first-push case is handled by the action.Why it matters
--only-verifiedmeans this job fires only on secrets TruffleHog has confirmed live against the provider. That's a high-signal alert, and it has been buried under four months of meaningless red X's. If a real credential landed on main, nobody would look.Heads up
320134e, "chore(infra): add trufflehog", bymr-uniswap) with these inputs already set. Other Uniswap repos seeded from that template are almost certainly red on main for the same reason — the fix likely belongs upstream too, or a template sync will revert this.Verification
The push-event path can't be exercised from a PR — it only runs after merge. What this PR can show is that the
pull_requestpath is unchanged (this PR's own TruffleHog check should pass exactly as before). The push path is confirmed by reading the action source at the pinned SHAb0fd951, quoted above.🤖 Generated with Claude Code