Skip to content

Commit b14271e

Browse files
lpcoxCopilot
andauthored
fix(workflow): prevent multiline GITHUB_OUTPUT in red-team benchmark (#4176)
grep -c outputs '0' to stdout even when it exits with code 1 (no matches). The || echo "0" fallback then appends a second '0', making AWF_BLOCKED a multiline value. When written to $GITHUB_OUTPUT, the bare '0' on the second line has no key= prefix, causing: ##[error]Invalid format '0' Fix: use || true instead — grep -c already outputs '0' on no-match, so the variable captures the correct value without duplication. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9b54764 commit b14271e

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

.github/workflows/red-team-benchmark.lock.yml

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/red-team-benchmark.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ steps:
196196
SQUID_LOG=$(find /tmp -name 'access.log' -path '*awf*' 2>/dev/null | head -1)
197197
fi
198198
if [ -n "$SQUID_LOG" ]; then
199-
AWF_BLOCKED=$(grep -c "DENIED" "$SQUID_LOG" 2>/dev/null || echo "0")
199+
AWF_BLOCKED=$(grep -c "DENIED" "$SQUID_LOG" 2>/dev/null || true)
200200
cp "$SQUID_LOG" /tmp/gh-aw/agent/squid-access.log
201201
else
202202
echo "No Squid access log found" > /tmp/gh-aw/agent/squid-access.log

0 commit comments

Comments
 (0)