Skip to content

Commit 6d1b944

Browse files
Copilotlpcox
andauthored
fix: handle SIGPIPE in Fetch PR changed files step to prevent missing delimiter error (#1651)
When the PR diff exceeds 8000 bytes, `gh api ... | head -c 8000` causes SIGPIPE (exit 141) on the gh api process. GitHub Actions bash uses `-eo pipefail`, so the pipeline failure aborts the subshell before writing the closing heredoc delimiter to GITHUB_OUTPUT, resulting in: ##[error]Invalid value. Matching delimiter not found 'GHAW_PR_FILES_...' Fix: add `|| true` after `head -c 8000` to swallow the SIGPIPE/pipefail error, ensuring the closing delimiter is always written to GITHUB_OUTPUT. Fixes failing job: https://github.com/github/gh-aw-firewall/actions/runs/23964770751/job/69902358339 Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/c8b8f958-f52e-4390-af7d-f094e20e68da Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
1 parent 2ddbaed commit 6d1b944

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/security-guard.lock.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/security-guard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ steps:
3232
echo "PR_FILES<<${DELIM}"
3333
gh api "repos/${GH_REPO}/pulls/${PR_NUMBER}/files" \
3434
--paginate --jq '.[] | "### " + .filename + " (+" + (.additions|tostring) + "/-" + (.deletions|tostring) + ")\n" + (.patch // "") + "\n"' \
35-
| head -c 8000
35+
| head -c 8000 || true
3636
echo "${DELIM}"
3737
} >> "$GITHUB_OUTPUT"
3838
env:

0 commit comments

Comments
 (0)