Skip to content

Commit 8f91b6c

Browse files
committed
add normalization for the keystore target path
1 parent 3f426e3 commit 8f91b6c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,12 @@ runs:
209209
else
210210
KEYSTORE_TARGET_PATH="$ANDROID_SOURCE_DIR/${{ inputs.keystore-path }}"
211211
fi
212-
echo "Keystore target path: $KEYSTORE_TARGET_PATH"
212+
213+
echo "Keystore target path before normalizing: $KEYSTORE_TARGET_PATH"
214+
while [[ "$KEYSTORE_TARGET_PATH" == *"/../"* ]]; do
215+
KEYSTORE_TARGET_PATH=$(echo "$KEYSTORE_TARGET_PATH" | sed 's|/[^/][^/]*/\.\./|/|')
216+
done
217+
echo "Keystore target path after normalizing: $KEYSTORE_TARGET_PATH"
213218
mkdir -p "$(dirname "$KEYSTORE_TARGET_PATH")" || {
214219
echo "Failed to create keystore directory: $(dirname "$KEYSTORE_TARGET_PATH")"
215220
exit 1

0 commit comments

Comments
 (0)