Skip to content

Commit f44fc9a

Browse files
Duologicisaiah-grafana
authored andcommitted
merge origin/main into test/zizmor-vendor-excludes-326
Resolve self-zizmor conflict: keep isaiah-grafana fork branch pin for #326. Relax fail-severity to critical on this pilot branch so high-severity zizmor findings do not block ruleset testing; restore high when pinning to upstream.
2 parents 043e87b + a680ecd commit f44fc9a

2 files changed

Lines changed: 25 additions & 5 deletions

File tree

.github/workflows/reusable-trufflehog.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,35 @@ jobs:
147147
fi
148148
149149
if [[ -s changed-files.txt ]]; then
150+
# One TruffleHog process over repo root; --include-paths file lists anchored regexes
151+
# (TruffleHog expects regex lines, not raw paths — see trufflesecurity docs).
152+
INCLUDE_REGEXES=/tmp/trufflehog-pr-include-regexes.txt
153+
: > "${INCLUDE_REGEXES}"
150154
while IFS= read -r file; do
151155
if [[ -s /tmp/exclude-regexes.txt ]] && echo "$file" | grep -qEf /tmp/exclude-regexes.txt 2>/dev/null; then
152156
echo "Skipping: ${file} (matches exclude pattern)"
153157
continue
154158
fi
155-
156159
if [[ -f "${file}" ]]; then
157-
echo "Scanning: ${file}"
158-
trufflehog filesystem "${file}" --exclude-paths /tmp/trufflehog-exclude.txt --concurrency 16 --json --no-update --results=verified,unverified >> results.ndjson || true
160+
python3 -c 'import re, sys; print("^" + re.escape(sys.argv[1]) + "$")' "$file" >> "${INCLUDE_REGEXES}"
159161
fi
160162
done < changed-files.txt
163+
164+
if [[ -s "${INCLUDE_REGEXES}" ]]; then
165+
sort -u -o "${INCLUDE_REGEXES}" "${INCLUDE_REGEXES}"
166+
n_inc=$(wc -l < "${INCLUDE_REGEXES}")
167+
echo "TruffleHog: ${n_inc} path(s) via --include-paths (anchored regexes)"
168+
: > results.ndjson
169+
trufflehog filesystem . \
170+
--include-paths "${INCLUDE_REGEXES}" \
171+
--exclude-paths /tmp/trufflehog-exclude.txt \
172+
--concurrency 16 \
173+
--json \
174+
--no-update \
175+
--results=verified,unverified > results.ndjson || true
176+
else
177+
echo "No files to scan after excludes (only deletions or excluded paths)"
178+
fi
161179
else
162180
echo "No files changed"
163181
fi
@@ -379,7 +397,7 @@ jobs:
379397
id-token: write
380398
steps:
381399
- name: Get Prometheus secrets from Vault
382-
uses: grafana/shared-workflows/actions/get-vault-secrets@078c4a8af09e06d646077550f9e0f68171d5881e # get-vault-secrets/v1.3.1
400+
uses: grafana/shared-workflows/actions/get-vault-secrets@f1614b210386ac420af6807a997ac7f6d96e477a # get-vault-secrets/v1.3.1
383401
with:
384402
common_secrets: |
385403
PROMETHEUS_URL=grafana-bench:prometheus_url

.github/workflows/self-zizmor.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ jobs:
5151
uses: isaiah-grafana/shared-workflows/.github/workflows/reusable-zizmor.yml@feat/zizmor-vendor-excludes-326
5252
with:
5353
runs-on: ${{ !github.event.repository.private && 'ubuntu-latest' || 'ubuntu-arm64-small' }}
54-
fail-severity: high
54+
# Pilot branch: only fail on critical so high-severity zizmor findings do not block ruleset/PR testing (#326).
55+
# Revert to high when swapping uses: back to grafana/shared-workflows@<merge SHA> on main.
56+
fail-severity: critical
5557
min-severity: high
5658
min-confidence: low
5759
extra-args: --offline

0 commit comments

Comments
 (0)