fix(ci): provision real ripgrep for secret-scanner workflow checks

Verify PCRE2 on every hosted test platform and coverage runner. Preserve dependency PATH for real scanner delegates and report missing prerequisites explicitly, keeping production fail-closed behavior and hermetic missing/error controls intact.
This commit is contained in:
haelyra
2026-10-10 18:41:02 -04:00
parent 630edba97e
commit a062b22a35
2 changed files with 43 additions and 2 deletions
+6 -2
View File
@@ -193,13 +193,17 @@ git_path="$(command -v git)"
awk_path="$(command -v awk)"
head_path="$(command -v head)"
cat_path="$(command -v cat)"
rg_path="$(command -v rg || true)"
rg_path="$(type -P rg || true)"
${scanner === 'real' ? `if [[ -z "$rg_path" ]]; then
printf 'Real scanner fixture requires ripgrep with PCRE2 support on PATH.\\n' >&2
exit 97
fi` : ''}
git() { "$git_path" "$@"; }
awk() { "$awk_path" "$@"; }
head() { "$head_path" "$@"; }
cat() { "$cat_path" "$@"; }
unset -f rg
PATH="${toBashPath(binDir)}"
${scanner === 'real' ? '# Preserve dependencies used by an actual scanner executable or wrapper.' : `PATH="${toBashPath(binDir)}"`}
${scanner ? `rg() {
printf '%s\\n' "$*" >> "${toBashPath(callsPath)}"
${scanner === 'real' ? '"$rg_path" "$@"' : scanner === 'finding' ? "printf '1:synthetic-scanner-finding\\n'; return 0;" : scanner === 'error' ? 'return 2;' : 'return 1;'}