You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(trufflehog): simplify exclusions to a single regex file
Replace the multi-file build pipeline (prefixes.txt, build_exclude_file.py,
update-excludes.sh, global-exclude.txt) and inline Python helper with a
single exclude-paths.txt containing Go regexes passed directly to
`trufflehog --exclude-paths`. Add a pattern, merge to main, done.
Made-with: Cursor
-o "${DEST}" 2>/dev/null && [[ -s "${DEST}" ]]; then
66
+
echo "Loaded exclude patterns from raw.githubusercontent.com"
82
67
else
83
-
echo "::warning::Could not fetch or rebuild TruffleHog excludes from ${REPO}@${REF}. Using last-resort bundled file — merge to main or fix token access."
84
-
# Last resort only: must match stdout of python3 trufflehog/build_exclude_file.py (same commit).
85
-
cat > "${DEST}" <<'EOF'
86
-
# Built from prefixes.txt + this script (CI does this on every run).
87
-
# Optional local copy: ./trufflehog/update-excludes.sh > trufflehog/global-exclude.txt
88
-
#
89
-
# --- directory prefixes (from prefixes.txt) ---
90
-
# prefix: content/grafana/dashboards
91
-
(^|\./|[/\\])content/grafana/dashboards([/\\]|$)
92
-
93
-
# --- static path patterns ---
94
-
# Lock files and checksums (contain hashes, not secrets)
95
-
path:go\.sum$
96
-
path:go\.mod$
97
-
98
-
# Dependency manifests (contain URLs that trigger false positives)
99
-
path:package\.json$
100
-
path:package-lock\.json$
101
-
path:pnpm-lock\.yaml$
102
-
path:yarn\.lock$
103
-
path:poetry\.lock$
104
-
path:Pipfile\.lock$
105
-
path:uv\.lock$
106
-
path:Cargo\.lock$
107
-
path:Gemfile\.lock$
108
-
109
-
# Grafana plugin metadata
110
-
path:grafana\.json$
111
-
EOF
68
+
echo "::warning::Could not fetch TruffleHog exclude patterns from ${REPO}. Scanning without exclusions."
69
+
touch "${DEST}"
112
70
fi
113
-
echo "--- effective exclude file ---"
71
+
72
+
echo "--- effective exclude patterns ---"
114
73
cat "${DEST}"
115
74
116
75
- name: Install TruffleHog
@@ -136,147 +95,17 @@ jobs:
136
95
set +e
137
96
echo "[]" > results.json
138
97
139
-
# Classify paths vs /tmp/trufflehog-exclude.txt (Python re ~ TruffleHog Go regexp for our patterns).
0 commit comments