From fae747ff1ad526db247d9da1c94e2aee95562820 Mon Sep 17 00:00:00 2001 From: Satoshi Qazi Muhammed Date: Sat, 17 Oct 2026 21:02:08 +0400 Subject: [PATCH] ci(security): scan new commits on push/PR and the current tree weekly `base: main` made every push to main rescan the whole history. Nova's own Infura keys, removed from the files in #72 but still in history and live, kept Secret Scan red on every push since at least 2026-09-21, so a new leak would have read as the same old red. - push and pull_request: no `base`, so the action scans only the commits the event brings (before..after, or the PR's base..head) - schedule: scan a `git archive HEAD` copy of today's tree - pin the action to v3.99.2 by commit and the image to 3.99.2 (was @main and latest) --- .github/workflows/security.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index d3f5bab..cb0601c 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -22,13 +22,28 @@ jobs: with: fetch-depth: 0 - - name: TruffleHog Secret Scan - uses: trufflesecurity/trufflehog@main + # Push and pull_request scan only the commits they bring: the action picks + # the range from the event. `base: main` made a push to main rescan the + # whole history, where Nova's own Infura keys (removed from the files in + # #72, still live and public upstream) kept this job red on every push + # since September, so a new leak would have looked like the old red. + - name: TruffleHog Secret Scan (new commits) + if: github.event_name != 'schedule' + uses: trufflesecurity/trufflehog@e76dff8a7e57d6df0c60ad8cbf5d5cba505a8fc9 # v3.99.2 with: path: ./ - base: ${{ github.event.repository.default_branch }} + version: 3.99.2 extra_args: --only-verified + # The weekly run checks what is in the tree today, not the history. + - name: TruffleHog Secret Scan (current tree) + if: github.event_name == 'schedule' + run: | + mkdir -p "$RUNNER_TEMP/tree" + git archive HEAD | tar -x -C "$RUNNER_TEMP/tree" + docker run --rm -v "$RUNNER_TEMP/tree:/tree" ghcr.io/trufflesecurity/trufflehog:3.99.2 \ + filesystem /tree --fail --no-update --github-actions --only-verified + hardcoded-secrets: name: Hardcoded Secret Detection runs-on: ubuntu-latest