ssh-action
ssh-action copied to clipboard
Environment variables are passed only to first command in script
- This action defines the input
scriptwhich is a single string (attempting to pass a list of commands results in error) - When multiple commands are chained with
cmd1 && cmd2they are passed to the container in theINPUT_SCRIPTenvironment variable - The drone-ssh plugin reads the
INPUT_SCRIPTenv var into thescript.stringwhich is described asexecute 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 -
cmd2does not get the environment variables added to its environment
+1