fix(workflow): prevent multiline GITHUB_OUTPUT in red-team benchmark#4176
Conversation
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>
There was a problem hiding this comment.
Pull request overview
Fixes a GitHub Actions workflow failure in the red-team benchmark by ensuring AWF_BLOCKED is written to $GITHUB_OUTPUT as a single-line key=value output, even when grep finds no matches.
Changes:
- Remove the
|| echo "0"fallback aftergrep -c "DENIED"to prevent producing a multilineAWF_BLOCKEDvalue. - Regenerate/update the locked workflow YAML to reflect the source workflow change.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/red-team-benchmark.md | Updates the AWF_BLOCKED assignment to avoid multiline $GITHUB_OUTPUT values when grep -c exits non-zero on no matches. |
| .github/workflows/red-team-benchmark.lock.yml | Propagates the same fix into the compiled/locked workflow output. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
Smoke Test: Claude Engine
Result: PASS
|
🔥 Smoke Test: Copilot BYOK (Offline Mode)
Running in BYOK offline mode ( Overall: PARTIAL — BYOK inference ✅, pre-step data not injected into prompt. PR by @lpcox.
|
|
Merged PRs: "fix(test): correct smoke-claude version assertion to match v0.76.1"; "fix: recompile all workflow lock files". Results: GitHub reads ✅; safeinputs-gh query ❌; Playwright ✅; file write ✅; bash verify ✅; discussion ✅; build ✅. Overall: FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
🤖 Smoke Test Results
Overall: PASS PR: fix(workflow): prevent multiline GITHUB_OUTPUT in red-team benchmark — author @lpcox
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Gemini Engine Smoke Test Results
Overall status: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
Smoke Test: GitHub Actions Services Connectivity
Overall: FAIL
|
Problem
The red-team benchmark workflow fails at step 15 ("Run AWF-protected benchmark") with:
Root cause:
grep -c "DENIED"outputs0to stdout even when it exits with code 1 (no matches). The|| echo "0"fallback then appends a second0, makingAWF_BLOCKEDa multiline value (0\n0). When written to$GITHUB_OUTPUT, the bare0on the second line has nokey=prefix — invalid format.Fix
Replace
|| echo "0"with|| true. Sincegrep -calready outputs0on no-match, the variable captures the correct single-line value.Failing run
https://github.com/github/gh-aw-firewall/actions/runs/26790836372/job/78976724535#step:15:1