Unable to Source Script in Pipeline

What is the proper way to source a script in an exec or ssh pipeline (runner executing shell commands directly on the host)? I am not experiencing the same results as if I was in an ssh session working with an interactive shell (i.e. Bash) on the same machine.

echo $0 normally would point to the type of shell session.
$ echo $0

when executing the Drone Pipeline I am observing what I appears to be the pipeline step as an executable.

  • echo $0

Feels like I am asking to source a new script from within another script rather than a shell session.

Drone executes your commands in non-interactive mode using /bin/sh

Also note the syntax for sourcing a script in /bin/sh may differ from /bin/bash

aware “source” keyword is specific to bash while ‘.’ can be used interchangeably. I am using ‘.’ to source.

I am expecting the following behavior:

$ . ./myscript.sh argument1

echo $0 - would expect this to be the shell
echo $1 - would expect this to be argument1

Drone’s build console logs are indicating a different behavior I am not following:
<step in .yaml>

- . ./myscript.sh argument1

echo $0 - path to the script represented by the current step
echo $1 - null