diff --git a/.github/actions/xahau-actions-cache-restore/action.yml b/.github/actions/xahau-actions-cache-restore/action.yml index 908e187c2..7c1497ecf 100644 --- a/.github/actions/xahau-actions-cache-restore/action.yml +++ b/.github/actions/xahau-actions-cache-restore/action.yml @@ -81,6 +81,14 @@ runs: echo "Use deltas: ${USE_DELTAS}" echo "" + # Normalize target path (expand tilde and resolve to absolute path) + # This ensures consistent path comparison in the mount registry + if [[ "${TARGET_PATH}" == ~* ]]; then + # Expand tilde manually (works even if directory doesn't exist yet) + TARGET_PATH="${HOME}${TARGET_PATH:1}" + fi + echo "Normalized target path: ${TARGET_PATH}" + # Generate unique cache workspace CACHE_HASH=$(echo "${CACHE_KEY}" | md5sum | cut -d' ' -f1) CACHE_WORKSPACE="/tmp/xahau-cache-${CACHE_HASH}" diff --git a/.github/actions/xahau-actions-cache-save/action.yml b/.github/actions/xahau-actions-cache-save/action.yml index 35a8f09d5..e6573ffec 100644 --- a/.github/actions/xahau-actions-cache-save/action.yml +++ b/.github/actions/xahau-actions-cache-save/action.yml @@ -52,6 +52,15 @@ runs: echo "S3 bucket: s3://${S3_BUCKET}" echo "" + # Normalize target path (expand tilde and resolve to absolute path) + # This ensures consistent path comparison with the mount registry + if [[ "${TARGET_PATH}" == ~* ]]; then + # Expand tilde manually (works even if directory doesn't exist yet) + TARGET_PATH="${HOME}${TARGET_PATH:1}" + fi + echo "Normalized target path: ${TARGET_PATH}" + echo "" + # Find the cache workspace from mount registry MOUNT_REGISTRY="/tmp/xahau-cache-mounts.txt"