Skip to content

Commit 89a46d1

Browse files
committed
fix(audit): use portable grep instead of ripgrep for CI portability
The v0.3.0 tag-push CI run failed on the tag-only 'audit.sh release' step with 'CHANGELOG missing v0.3.0 section' even though the section was present. Root cause: audit.sh used rg (ripgrep) for the CHANGELOG check and 5 other checks, but the GitHub ubuntu-latest runner does not ship rg on PATH; errors were masked by 2>/dev/null, so the release gate failed while audit.sh all's rg-based checks silently false-passed in CI. Replace all 6 rg calls with portable grep: grep -qF for fixed-string single-file checks (closeout), grep -rq for the two recursive runtime scans, and grep -q for the CHANGELOG regex. Matches the README POSIX-grep portability contract. Confirmed locally by shadowing rg with a not-found stub: release now passes and all passes end-to-end.
1 parent 8e29009 commit 89a46d1

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

.opencode/audit.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,18 @@ run_closeout() {
134134
# Trigger only when the skill declares a closeout marker.
135135
local has_marker=0 m
136136
for m in "${markers[@]}"; do
137-
if rg -q -F "$m" "$f" 2>/dev/null; then has_marker=1; break; fi
137+
if grep -qF "$m" "$f" 2>/dev/null; then has_marker=1; break; fi
138138
done
139139
if [ "$has_marker" -eq 0 ]; then
140140
pass "$s (no closeout marker; skipped)"
141141
continue
142142
fi
143143
local missing=() bad=()
144144
for m in "${required[@]}"; do
145-
if ! rg -q -F "$m" "$f" 2>/dev/null; then missing+=("$m"); fi
145+
if ! grep -qF "$m" "$f" 2>/dev/null; then missing+=("$m"); fi
146146
done
147147
for m in "${forbidden[@]}"; do
148-
if rg -q -F "$m" "$f" 2>/dev/null; then bad+=("$m"); fi
148+
if grep -qF "$m" "$f" 2>/dev/null; then bad+=("$m"); fi
149149
done
150150
if [ "${#missing[@]}" -eq 0 ] && [ "${#bad[@]}" -eq 0 ]; then
151151
pass "$s (closeout routing complete)"
@@ -163,13 +163,13 @@ run_runtime() {
163163
printf '\n── Runtime References ──────────────────────────────────────\n'
164164
# Check for stale Claude references
165165
local stale=0
166-
if rg -q '\.claude/' "$root"/.opencode/agents/ "$root"/.opencode/skills/ 2>/dev/null; then
166+
if grep -rq '\.claude/' "$root"/.opencode/agents/ "$root"/.opencode/skills/ 2>/dev/null; then
167167
fail "stale .claude/ references in agents/skills"
168168
stale=1
169169
else
170170
pass "no .claude/ references"
171171
fi
172-
if rg -q 'CLAUDE\.md' "$root"/.opencode/agents/ "$root"/.opencode/skills/ 2>/dev/null; then
172+
if grep -rq 'CLAUDE\.md' "$root"/.opencode/agents/ "$root"/.opencode/skills/ 2>/dev/null; then
173173
fail "stale CLAUDE.md references"
174174
stale=1
175175
else
@@ -275,7 +275,7 @@ run_release() {
275275
pass "VERSION: $version"
276276

277277
# Check CHANGELOG has the section
278-
if [ -f "$changelog" ] && rg -q "^## v${version}" "$changelog" 2>/dev/null; then
278+
if [ -f "$changelog" ] && grep -q "^## v${version}" "$changelog" 2>/dev/null; then
279279
pass "CHANGELOG has v$version section"
280280
else
281281
fail "CHANGELOG missing v$version section"

0 commit comments

Comments
 (0)