Skip to content

Commit 8ee4dd6

Browse files
committed
fix upload dir
1 parent 4ea72ac commit 8ee4dd6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

action.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,16 @@ runs:
5656
URL="${{ steps.prepare.outputs.uploadApiEndpoint }}"
5757
IDTOKEN="${{ steps.prepare.outputs.idtoken }}"
5858
VERBOSE="${{ inputs.verbose }}"
59+
UPLOAD_DIR="${{ inputs.site-dir }}"
5960
6061
[[ "$VERBOSE" == "true" ]] && CURL_OPTS="-v" || CURL_OPTS="--silent"
6162
6263
# Build curl arguments for multipart/form-data, preserving relative paths
6364
CURL_ARGS=()
6465
while IFS= read -r -d '' file; do
65-
relpath="${file#${{ inputs.dir }}}"
66+
relpath="${file#$UPLOAD_DIR}" # Remove the base directory from the path
6667
CURL_ARGS+=("-F" "files[${relpath}]=@${file}")
67-
done < <(find ${{ inputs.dir }} -type f -print0)
68+
done < <(find $UPLOAD_DIR -type f -print0)
6869
6970
FILE_COUNT="${#CURL_ARGS[@]}"
7071
echo "Uploading $FILE_COUNT files to $URL..."

0 commit comments

Comments
 (0)