Try to use a Run Shell Script action like this instead:
for f;do cd "${f%/*}";zip "${f##*/}.zip" -x .DS_Store -r0 "${f##*/}";done
${f%/*}
removes the shortest /*
pattern from the end of f
and ${f##*/}
removes the longest */
pattern from the start of f
.