From d6b167362fa55037353bc808d42791f879e946c0 Mon Sep 17 00:00:00 2001 From: Will Gordon Date: Wed, 4 Nov 2026 10:32:46 -0500 Subject: [PATCH 1/2] ci: migrates secret scanning from trufflehog to betterleaks --- .github/workflows/test_lint_scan.yml | 6 ++++-- prek.toml | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_lint_scan.yml b/.github/workflows/test_lint_scan.yml index 9c66e2a..6e19e5b 100644 --- a/.github/workflows/test_lint_scan.yml +++ b/.github/workflows/test_lint_scan.yml @@ -59,7 +59,7 @@ jobs: run: uv sync --locked --no-default-groups --group build --group lint --group typing --group test --no-editable - name: Run Linting and Type Checking env: - SKIP: pytest,actionlint,zizmor,no-commit-to-branch + SKIP: pytest,actionlint,zizmor,betterleaks,no-commit-to-branch UV_NO_SYNC: "1" run: uv run --no-sync prek run --all-files - name: Run Benchmark and Bounded Collision Suite @@ -146,4 +146,6 @@ jobs: env: CODEQL_EXTRACTOR_PYTHON_ANALYSIS_VERSION: "3.13" - name: Perform Secure Code Analysis (Secrets) - uses: trufflesecurity/trufflehog@31ce31ee1abbcc7dc8eee5764c17121c3044c8b2 # v3.99.7 + env: + UV_NO_SYNC: "1" + run: uv run --no-sync prek run --all-files betterleaks diff --git a/prek.toml b/prek.toml index 422080b..d3e3726 100644 --- a/prek.toml +++ b/prek.toml @@ -24,6 +24,13 @@ hooks = [ { id = "actionlint", pass_filenames = false, priority = 0 }, ] +[[repos]] +repo = "https://github.com/betterleaks/betterleaks" +rev = "81aff7a638638aae3a659845d089043e1d8fe9ac" # v1.9.0 +hooks = [ + { id = "betterleaks", name = "Betterleaks secret scan", entry = "betterleaks dir --no-banner --redact --verbose --confidence medium", pass_filenames = true, stages = ["pre-commit", "pre-push"], priority = 0 }, +] + [[repos]] repo = "local" hooks = [ From 186970f3e487fe8b304429dff82578a2a9846c72 Mon Sep 17 00:00:00 2001 From: Will Gordon Date: Sun, 8 Nov 2026 21:25:45 -0500 Subject: [PATCH 2/2] ci: run betterleaks in the lint prek invocation prek executes hooks in parallel, so the dedicated scan-job step duplicates work the lint job's single prek run already does. --- .github/workflows/test_lint_scan.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/test_lint_scan.yml b/.github/workflows/test_lint_scan.yml index 6e19e5b..0a685cd 100644 --- a/.github/workflows/test_lint_scan.yml +++ b/.github/workflows/test_lint_scan.yml @@ -59,7 +59,7 @@ jobs: run: uv sync --locked --no-default-groups --group build --group lint --group typing --group test --no-editable - name: Run Linting and Type Checking env: - SKIP: pytest,actionlint,zizmor,betterleaks,no-commit-to-branch + SKIP: pytest,actionlint,zizmor,no-commit-to-branch UV_NO_SYNC: "1" run: uv run --no-sync prek run --all-files - name: Run Benchmark and Bounded Collision Suite @@ -145,7 +145,3 @@ jobs: category: "/language:python" env: CODEQL_EXTRACTOR_PYTHON_ANALYSIS_VERSION: "3.13" - - name: Perform Secure Code Analysis (Secrets) - env: - UV_NO_SYNC: "1" - run: uv run --no-sync prek run --all-files betterleaks