How are commands transformed into scripts?

I’m running into problems with how Drone transforms commands into shell scripts. Is there any documentation for this transformation or a way to see the final script? The documentation for docker runner / steps only says:
“The commands in the above example are roughly converted to the below script:”
" The below docker command is an (incomplete) example of how the script is executed"

For example, one of the issues I have is I specify shell: /bin/bash but then the script fails on /bin/sh: 36: [[: not found. It seems that in this case generated script uses sh instead of bash?

I obtained the script by copying /usr/drone/bin/init

It seems that in this case generated script uses sh instead of bash?

This is correct, Drone uses /bin/sh. There is no option to override the default shell.