From b7c8953cb4d4a2541dcb38865c8a7beef0edf494 Mon Sep 17 00:00:00 2001 From: paul Date: Sun, 20 Jul 2025 22:17:47 +0200 Subject: [PATCH] fix: resolve SIGPIPE error in GitHub mirror workflow file cleanup - 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. --- .gitea/workflows/mirror-to-github.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/mirror-to-github.yml b/.gitea/workflows/mirror-to-github.yml index f679e5b..81efb63 100644 --- a/.gitea/workflows/mirror-to-github.yml +++ b/.gitea/workflows/mirror-to-github.yml @@ -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: |