fix: resolve SIGPIPE error in GitHub mirror workflow file cleanup
Mirror to GitHub / mirror (push) Successful in 1m23s
continuous-integration/drone/push Build is passing
Test and Lint / backend-test (push) Successful in 2m6s
Test and Lint / frontend-test (push) Has started running

- Replace problematic 'find | head -20' commands that caused exit code 141
- Use 'ls -la | head -10 || true' for safer file listing
- Add better progress logging during sensitive file removal
- Add error handling with '|| true' to prevent pipe failures

The find command was outputting more than head could handle, causing
SIGPIPE when head closed the pipe early. This fix uses ls which is
more predictable and adds proper error handling.
This commit is contained in:
2025-07-20 22:17:47 +02:00
parent 1ac5b0447a
commit 505acf833e
+7 -3
View File
@@ -113,9 +113,11 @@ jobs:
git checkout github-mirror
echo "Current files before cleanup:"
find . -name ".*" -o -name "*" | head -20
ls -la | head -10 || true
echo "..."
# Remove sensitive files/directories if they exist
echo "Removing sensitive files..."
rm -rf .env* || true
rm -rf backend/.env* || true
rm -rf frontend/.env* || true
@@ -136,6 +138,8 @@ jobs:
rm -rf test-maintenance.sh || true
rm -rf storage/ || true
echo "Sensitive files removal completed"
# Add and commit the cleanup if there are changes
git add -A
if ! git diff --cached --quiet; then
@@ -145,8 +149,8 @@ jobs:
echo "✅ No sensitive files to remove"
fi
echo "Final file structure:"
find . -name ".*" -o -name "*" | head -20
echo "Final file structure (top level):"
ls -la | head -10 || true
- name: Verify clean history
run: |