ssh-action icon indicating copy to clipboard operation
ssh-action copied to clipboard

Environment variables are passed only to first command in script

Open gtirloni opened this issue 3 years ago • 1 comments

  • This action defines the input script which is a single string (attempting to pass a list of commands results in error)
  • When multiple commands are chained with cmd1 && cmd2 they are passed to the container in the INPUT_SCRIPT environment variable
  • The drone-ssh plugin reads the INPUT_SCRIPT env var into the script.string which is described as execute single commands for github action
  • All the environment variable passed to drone-ssh are concatenated and appended to the begining of the command that will be executed, resulting in ENV1=VAL1 ENV2=VAL2 cmd1 && cmd2
  • cmd2 does not get the environment variables added to its environment

gtirloni avatar Jul 04 '22 21:07 gtirloni

+1

OmarSRolo avatar Sep 04 '22 19:09 OmarSRolo