Repository navigation
fix(ci): the secret scan skips templ's generated Go - #146
Merged
Merged
Conversation
A full-tree scan (make secret-scan ARGS=--all, which make nightly runs) fails on generated templ code: "apiclient.BuybackQuoted:" followed by "templ_7745c5c3_Err" reads to gitleaks' generic-api-key rule as a key (sparkrack apps/web/ui/pages_buyback_templ.go). The scan now skips x_templ.go when x.templ sits beside it (verify.GeneratedTempl), in every mode: the checkout, named files, --all and a PR head read as data. The .templ stays scanned; a _templ.go with no source is scanned like any file. Proof: a Stripe key planted in apps/admin/ui/pages_auth.templ and its _templ.go is reported in the .templ (named files and --all); the _templ.go alone is skipped; with the plant removed, --all is clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jayleaton
force-pushed
the
fix/secret-scan-skip-generated-templ
branch
from
October 31, 2026 18:08
29ef241 to
18c101a
Compare
Owner
Author
|
Authorized by JJ, merged by Claude (Opus 5.5, Doug) with --admin after make ci-local attested 18c101a |
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.
Problem
A full-tree secret scan (
make secret-scan ARGS=--all, whichmake nightlyruns) fails on generated templ code. In sparkrack,apiclient.BuybackQuoted:followed bytempl_7745c5c3_Errreads to gitleaks' generic-api-key rule as a key.Fix
x_templ.gowhenx.templsits beside it (verify.GeneratedTempl), in every mode: checkout, named files,--all, and a PR head read as data..templfile stays scanned. A_templ.gowith no source beside it is scanned like any other file, andmake check-generatedfails one that templ did not generate..gitleaks.tomlis unchanged.apps/admin/ui/pages_auth.templand its_templ.go. The scan reported it in the.templ(named files and--all). Given only the_templ.go, it scanned nothing. With the plant removed,--allis clean.Local verification
Head
18c101a4dc98399515881b32309880e34e3e37e8· tree3877671025b5· passedAttested by
JJ EatononMacBook-Pro-3.localRan: Rebased onto 3d558d6 (#145). make ci passed on this change before the rebase (4 vCPU Davit box); on this exact head: go build ./..., go vet ./..., go test ./scripts/cilocal/..., golangci-lint ./scripts/cilocal/..., make secret-scan ARGS=--all (465 files, no leaks), pre-push make check-fast; the planted-key proof (reported in the .templ, generated Go skipped). Same change merged in sparkrack as #56.
🤖 Generated with Claude Code