From c998d21a4f151bf894aa798ba4a94690d9092bf0 Mon Sep 17 00:00:00 2001 From: dtzp555-max Date: Tue, 5 May 2026 09:54:36 +1000 Subject: [PATCH] chore(ci): add gitleaks workflow to scan PRs and pushes to main (#64) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The repo has shipped `.gitleaks.toml` (with project-specific allowlist entries — public OAuth client ID, README placeholders, an old plan doc) since the privacy remediation work, but no GitHub Action invoked it. The config was orphan: real protection only when someone ran gitleaks locally, never gating merges. This workflow wires `.gitleaks.toml` into CI: - Triggers on every `pull_request` (any branch) and `push` to `main`. - Uses `gitleaks/gitleaks-action@v2`, which auto-detects the repo-root `.gitleaks.toml` and applies its allowlist. - Hard-fails on any leak. No `continue-on-error`. Public repo policy. - `permissions: contents: read` — minimum required scope. - `fetch-depth: 0` so the action can scan full history (the action's default behavior; explicit here for clarity). Verification path: - The workflow runs on this PR itself; if any secret were ever committed to the repo, the scan fails here. Prior audit confirmed the tracked tree is clean of real secrets, so this PR's own scan should pass. Refs: audit side-finding 4 of 4. Co-authored-by: dtzp555 Co-authored-by: Claude Opus 4.7 --- .github/workflows/gitleaks.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 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..3c596e6 --- /dev/null +++ b/.github/workflows/gitleaks.yml @@ -0,0 +1,32 @@ +name: gitleaks + +# Secret scanning gate. Runs on every PR (any branch) and every push to main. +# Configuration is read from the repo-root `.gitleaks.toml` automatically. +# Hard-fails the build on any detected leak — public repo, no tolerance. +# +# To extend the allowlist (e.g. a new known-safe placeholder), edit +# `.gitleaks.toml`. Do not add `continue-on-error` here without an explicit +# governance decision. + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +jobs: + scan: + name: gitleaks scan (hard fail) + runs-on: ubuntu-latest + steps: + - name: Checkout (full history) + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Run gitleaks + uses: gitleaks/gitleaks-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}