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