Skip to content

Commit c5a1c49

Browse files
committed
fix: source_path
1 parent 63eb57a commit c5a1c49

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

action.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,27 @@ runs:
6161
fi
6262
6363
DEBUG="${{ inputs.debug }}"
64-
INPUT_PATHS=${{ inputs.source_path }}
64+
INPUT_PATHS="${{ inputs.source_path }}"
6565
CUTOFF_OPTION=$([ -n "${{ inputs.upload_cutoff }}" ] && echo "--drive-upload-cutoff=${{ inputs.upload_cutoff }}" || echo "")
6666
6767
# Create a temporary file to store all matched file paths
6868
MATCHED_FILES=$(mktemp)
6969
70-
for file in $INPUT_PATHS; do
71-
echo "$file" >> "$MATCHED_FILES"
72-
done
70+
# Process each line of input paths
71+
while IFS= read -r line; do
72+
# Skip empty lines
73+
[[ -z "$line" ]] && continue
74+
75+
# Expand the glob pattern and add matching files
76+
for file in $line; do
77+
if [[ -e "$file" ]]; then
78+
echo "$file" >> "$MATCHED_FILES"
79+
fi
80+
done
81+
done <<< "$INPUT_PATHS"
7382
7483
if [ "$DEBUG" = true ]; then
84+
echo "Matched files:"
7585
cat "$MATCHED_FILES"
7686
fi
7787
@@ -87,4 +97,7 @@ runs:
8797
echo "Uploading $file to google_drive:${{ inputs.destination_path }}"
8898
rclone copy $CUTOFF_OPTION "$file" "google_drive:${{ inputs.destination_path }}"
8999
done < "$MATCHED_FILES"
100+
101+
# Clean up
102+
rm "$MATCHED_FILES"
90103

0 commit comments

Comments
 (0)