Skip to content

Commit 43e7f02

Browse files
Bump grafana-bench to v1.0.8 and pass exclusion file
Updates the TruffleHog workflow to use grafana-bench v1.0.8 which supports the --trufflehog-exclude-file flag. When a repo has a .trufflehogignore, the merged exclude file is passed to grafana-bench so exclusion pattern metrics are emitted to Prometheus. Made-with: Cursor
1 parent fbae154 commit 43e7f02

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/reusable-trufflehog.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,10 @@ jobs:
332332
fi
333333
} > trufflehog_scan.txt
334334
335+
- name: Copy exclude file into workspace for artifact upload
336+
if: always()
337+
run: cp /tmp/trufflehog-exclude.txt trufflehog-exclude.txt 2>/dev/null || true
338+
335339
- name: Upload scan results
336340
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
337341
if: always()
@@ -340,6 +344,7 @@ jobs:
340344
path: |
341345
trufflehog_scan.txt
342346
results.json
347+
trufflehog-exclude.txt
343348
if-no-files-found: warn
344349
retention-days: 2
345350

@@ -396,17 +401,23 @@ jobs:
396401
echo "::error::PROMETHEUS_URL not set; Vault step may have failed."
397402
exit 1
398403
fi
399-
if ! docker pull ghcr.io/grafana/grafana-bench:v1.0.4; then
404+
if ! docker pull ghcr.io/grafana/grafana-bench:v1.0.8; then
400405
echo "Could not pull Bench image; skipping bench step."
401406
exit 0
402407
fi
408+
409+
EXCLUDE_FLAG=""
410+
if [[ -f "trufflehog-exclude.txt" ]]; then
411+
EXCLUDE_FLAG="--trufflehog-exclude-file /tests/trufflehog-exclude.txt"
412+
fi
413+
403414
docker run --rm \
404415
--network=host \
405416
--volume="${PWD}:/tests/" \
406417
-e PROMETHEUS_URL="${PROMETHEUS_URL}" \
407418
-e PROMETHEUS_USER="${PROMETHEUS_USER}" \
408419
-e PROMETHEUS_PASSWORD="${PROMETHEUS_PASSWORD}" \
409-
ghcr.io/grafana/grafana-bench:v1.0.4 report \
420+
ghcr.io/grafana/grafana-bench:v1.0.8 report \
410421
--report-input trufflehog \
411422
--service "${BENCH_SERVICE}" \
412423
--service-version "${BENCH_SERVICE_VERSION}" \
@@ -415,4 +426,5 @@ jobs:
415426
--report-output log \
416427
--log-level debug \
417428
--prometheus-metrics \
429+
${EXCLUDE_FLAG} \
418430
/tests/results.json

0 commit comments

Comments
 (0)