addnab / docker-run-action

MIT License
209 stars 93 forks source link

Newline replacement with semicolon not always safe #38

Open skeggse opened 1 year ago

skeggse commented 1 year ago

Some scripts can't be directly converted by string replacement. A good example is a for loop:

for value in 1 2 3 4; do
  echo "$value"
done

This gets converted to for value in 1 2 3 4; do; echo "$value"; done, causing:

ash: syntax error: unexpected ";"

The extra ; after the do is the source of this particular error.

It seems that simply passing in the script unchanged works fine; what's the intent behind modifying the input run value instead of passing it in with the newlines intact?