ci: scan Git history with gitleaks
ci / gitleaks (push) Successful in 10s
ci / docker (push) Successful in 3m5s

This commit is contained in:
2026-09-08 11:10:34 +08:00
parent 42b0e37d96
commit 356fbfa942
+28
View File
@@ -4,6 +4,9 @@ on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
env:
APP_NAME: aws-dodo
@@ -17,7 +20,32 @@ env:
ARGOCD_URL: argocd.bboysoul.cn
jobs:
gitleaks:
runs-on: docker
container:
options: --user=root
steps:
- name: Check out repository history
uses: https://github.com/actions/checkout@v4
with:
fetch-depth: 0
- name: Scan Git history for secrets
shell: bash
run: |
set -euo pipefail
GITLEAKS_VERSION=8.30.1
ARCHIVE="gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz"
curl --fail --silent --show-error --location \
--output "/tmp/${ARCHIVE}" \
"https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/${ARCHIVE}"
echo "551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb /tmp/${ARCHIVE}" | sha256sum --check --strict
tar -xzf "/tmp/${ARCHIVE}" -C /usr/local/bin gitleaks
gitleaks git --redact --no-banner --verbose --log-opts="--all" .
docker:
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/main'
needs: gitleaks
runs-on: docker
container:
options: --user=root