From 9b388ff8e2abd3928a22850a043eeca4403480f8 Mon Sep 17 00:00:00 2001 From: kasun Date: Mon, 23 Nov 2026 00:12:57 +0100 Subject: [PATCH] chore(ci): scan full Git history for secrets Covers commits that never ran the local hook, such as edits made in the Gitea web editor. --- .gitea/workflows/secret-scan.yaml | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .gitea/workflows/secret-scan.yaml diff --git a/.gitea/workflows/secret-scan.yaml b/.gitea/workflows/secret-scan.yaml new file mode 100644 index 0000000..de40d57 --- /dev/null +++ b/.gitea/workflows/secret-scan.yaml @@ -0,0 +1,34 @@ +name: Secret Scan + +on: + workflow_dispatch: + push: + branches: + - main + pull_request: + branches: + - main + +env: + BETTERLEAKS_VERSION: "1.10.1" + BETTERLEAKS_SHA256: c174b42d7aa60caf58c0c3e555c0e4bed01fe6b0d99a412bce777b5af4ce913e + +jobs: + scan: + name: Betterleaks + runs-on: ubuntu-latest + steps: + - name: Checkout Full History + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Betterleaks + run: | + curl -fsSL -o /tmp/betterleaks.tar.gz \ + "https://github.com/betterleaks/betterleaks/releases/download/v${BETTERLEAKS_VERSION}/betterleaks_${BETTERLEAKS_VERSION}_linux_x64.tar.gz" + echo "${BETTERLEAKS_SHA256} /tmp/betterleaks.tar.gz" | sha256sum -c - + tar -xzf /tmp/betterleaks.tar.gz -C /tmp betterleaks + + - name: Scan Git History + run: /tmp/betterleaks git . --redact --verbose --no-banner --no-color --log-opts="--all -m -p -U0"