Skip to content

fix(skills): sync-baseline --dry-run + pr-resolve/gate-c/review-req correctness (F30, F32, F4b, F13) #643

fix(skills): sync-baseline --dry-run + pr-resolve/gate-c/review-req correctness (F30, F32, F4b, F13)

fix(skills): sync-baseline --dry-run + pr-resolve/gate-c/review-req correctness (F30, F32, F4b, F13) #643

Workflow file for this run

name: Secret Scan
on:
push:
branches: [main, staging]
pull_request:
branches: [main, staging]
permissions:
contents: read
jobs:
trufflehog:
name: TruffleHog (history scan)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout (full history)
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: TruffleHog scan
uses: trufflesecurity/trufflehog@v3.93.6
with:
extra_args: --only-verified --results=verified,unknown
gitleaks-ci:
name: Gitleaks (backup scan)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install gitleaks
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
GITLEAKS_VERSION=$(curl -sH "Authorization: Bearer $GH_TOKEN" https://api.github.com/repos/gitleaks/gitleaks/releases/latest | grep '"tag_name"' | sed 's/.*"v\(.*\)".*/\1/')
if [ -z "$GITLEAKS_VERSION" ]; then
echo "::error::Failed to fetch latest gitleaks version from GitHub API"
exit 1
fi
echo "Installing gitleaks v${GITLEAKS_VERSION}"
curl -sSfL "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" | tar xz
chmod +x gitleaks
- name: Gitleaks scan
run: ./gitleaks detect --source . --config .gitleaks.toml --redact --verbose
detect-secrets-ci:
name: detect-secrets (baseline check)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install detect-secrets
run: pip install "detect-secrets>=1.5,<2"
- name: Check baseline
run: |
# Save committed baseline results (strip timestamp which always changes)
python3 -c "import json,sys; d=json.load(open('.secrets.baseline')); del d['generated_at']; json.dump(d,sys.stdout,sort_keys=True)" > /tmp/before.json
# Re-scan and update baseline in-place
detect-secrets scan \
--baseline .secrets.baseline \
--exclude-files 'node_modules/.*' \
--exclude-files '\.planning/.*' \
--exclude-files 'bin/secrets\.test\.cjs' \
--exclude-files 'bin/ccr-secure-config\.test\.cjs' \
--exclude-files 'bin/set-secret\.test\.cjs' \
--exclude-files 'bin/install-helpers\.test\.cjs' \
--exclude-files '\.secrets\.baseline'
# Compare results ignoring timestamp
python3 -c "import json,sys; d=json.load(open('.secrets.baseline')); del d['generated_at']; json.dump(d,sys.stdout,sort_keys=True)" > /tmp/after.json
if diff /tmp/before.json /tmp/after.json > /dev/null; then
echo "Baseline unchanged — no new secrets detected"
else
echo "::error::New secrets detected! Run 'detect-secrets scan --baseline .secrets.baseline' locally, audit with 'detect-secrets audit .secrets.baseline', then commit."
diff /tmp/before.json /tmp/after.json || true
exit 1
fi