From 7953926fb7e90ed369f19f8a138358de68d6483c Mon Sep 17 00:00:00 2001 From: satyakwok <119509589+satyakwok@users.noreply.github.com> Date: Sun, 10 May 2026 23:17:41 +0200 Subject: [PATCH] ci: add gitleaks secret-scan workflow Matches the pattern in sentrix-labs/sentrix and the other Sentriscloud repos. Uses gitleaks binary v8.30.1 directly (gitleaks-action@v2 is paid for organizations). Non-blocking; surfaces findings as PR warnings. --- .github/workflows/gitleaks.yml | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/gitleaks.yml diff --git a/.github/workflows/gitleaks.yml b/.github/workflows/gitleaks.yml new file mode 100644 index 0000000..72b52cd --- /dev/null +++ b/.github/workflows/gitleaks.yml @@ -0,0 +1,45 @@ +name: gitleaks + +# Secret-scan every PR + every push to main + manual on demand. Catches +# credentials accidentally committed (API keys, signed RPC URLs, +# private-key fixtures, hardcoded JWTs) before they hit shared history. +# +# Uses the gitleaks BINARY directly — gitleaks-action@v2 is paid for +# GitHub Organizations since 2023; the binary itself is open-source MIT +# and has no such restriction. Pinned to v8.30.1 (latest release as of +# 2026-05-10). Bump deliberately, not via dependabot, so a regex change +# upstream doesn't silently break a passing build. +# +# Non-blocking on findings (exits with `|| echo ::warning::`). Required +# branch protection still gates that the scan ran; surface findings +# show up as PR check warnings + workflow summary so an operator can +# decide whether to redact and force-push or accept the finding. + +on: + pull_request: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +jobs: + gitleaks: + name: gitleaks (secret scan) + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 # full history so commit-range scan covers the whole tree + - name: Install gitleaks + run: | + GITLEAKS_VERSION=8.30.1 + wget -q "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" + tar xzf "gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" + sudo mv gitleaks /usr/local/bin/ + gitleaks version + - name: Run gitleaks + run: | + gitleaks detect --source . --redact --verbose \ + || echo "::warning::gitleaks findings (non-blocking)"