test
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
dvirlabs 2026-04-24 02:27:24 +03:00
parent c0b4cf27c6
commit d2e747880c

View File

@ -74,12 +74,12 @@ if [ "$MODE" = "post-deploy" ]; then
if command -v git >/dev/null 2>&1 && [ -d .git ]; then
# Try multiple methods to detect changed files (Woodpecker might do shallow clone)
# Method 1: Use git show to see files in HEAD commit
CHANGED_FILE_PATHS=$(git show --name-only --pretty="" HEAD -- files/ 2>/dev/null || echo "")
# Method 1: Use git diff to see actual file changes (most accurate)
CHANGED_FILE_PATHS=$(git diff --name-only HEAD~1 HEAD -- files/ 2>/dev/null || echo "")
# Method 2: If method 1 fails, try diff with parent (if it exists)
# Method 2: If method 1 fails (no parent commit), use git show
if [ -z "$CHANGED_FILE_PATHS" ]; then
CHANGED_FILE_PATHS=$(git diff --name-only HEAD~1 HEAD -- files/ 2>/dev/null || echo "")
CHANGED_FILE_PATHS=$(git show --name-only --pretty="" HEAD -- files/ 2>/dev/null || echo "")
fi
# Method 3: If still nothing, check Woodpecker CI environment variables