From a8e3a8f2e52d54323d9291e9d3848e1ce02c18f8 Mon Sep 17 00:00:00 2001 From: Walternater <11957989+Walternater@users.noreply.github.com> Date: Thu, 19 Nov 2026 19:57:51 +0800 Subject: [PATCH] fix(local): require ripgrep for the forbidden-content scans The validate and release-local workflows never installed ripgrep, and validate.sh reads a missing rg (exit 127) as "no match" inside if-rg, so every forbidden-content scan skipped silently while the job printed "Validation passed." (issue #1044). - validate.sh now fails loudly when rg is not on PATH. - Both workflows install ripgrep before running validate.sh. Merge after #909: apt ships rg 15.1.0 on resolute (ubuntu-latest) and 14.1.0 on noble; with rg present, 15.x glob handling self-matches scripts/validate.sh in scan 1 (the known bug #909 fixes, noble unaffected). Until #909 merges, validate (3.12) shows that known failure on this branch. Co-Authored-By: Claude Code --- .github/workflows/release-local.yml | 5 ++++- .github/workflows/validate.yml | 2 ++ local/scripts/validate.sh | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-local.yml b/.github/workflows/release-local.yml index e4331554d..ac634f8a8 100644 --- a/.github/workflows/release-local.yml +++ b/.github/workflows/release-local.yml @@ -84,7 +84,10 @@ jobs: } >> "$GITHUB_OUTPUT" - name: Install validation dependencies - run: python3 -m pip install pyyaml==6.0.3 + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends ripgrep + python3 -m pip install pyyaml==6.0.3 - name: Validate release contents run: | diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 8b3ed6bc9..52fa3ae24 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -24,6 +24,8 @@ jobs: python-version: ["3.8", "3.12"] steps: - uses: actions/checkout@v7.0.1 + # validate.sh gates its forbidden-content scans on ripgrep being present. + - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends ripgrep - uses: actions/setup-python@v5.6.0 with: python-version: ${{ matrix.python-version }} diff --git a/local/scripts/validate.sh b/local/scripts/validate.sh index 9df7543b1..34106e770 100755 --- a/local/scripts/validate.sh +++ b/local/scripts/validate.sh @@ -4,6 +4,13 @@ set -euo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" cd "$ROOT_DIR" +# A missing rg exits 127, which `if rg` treats like "no match", silently +# skipping every scan below (issue #1044). Fail loudly instead. +command -v rg >/dev/null 2>&1 || { + echo "ripgrep (rg) is required; the forbidden-content scans cannot run." >&2 + exit 1 +} + echo "[1/6] Checking forbidden public content" if rg --hidden -n \ -e 'Tencent/multi-agents-dev-workflow-open-source' \