Fix SIGPIPE error in detect_changes when many files changed
Summary
When thousands of files change (common in repos with many test files like hivemind),
piping to head -50 causes SIGPIPE (exit code 141) when echo tries to write more data
after head has closed the pipe.
Problem
echo "$CHANGED_FILES" | head -50 # SIGPIPE if CHANGED_FILES has >50 lines
This was causing hivemind MR !956 pipeline to fail in the detect_changes job.
Fix
Add || true to suppress the SIGPIPE error:
echo "$CHANGED_FILES" | head -50 || true
Also added total file count when output is truncated for better visibility.
Test
- Retry hivemind MR !956 pipeline after merge