Use variables in SSH Commands or SFTP Remote Path

Hi, for each pull request I would like build and deploy to a specific path on the server.

After the build process I have a SSH command to create the directory per pull request something like:
mkdir -p /home/reviewapp/pullrequest/$BUDDY_EXECUTION_PULL_REQUEST_NO

In the SFTP action I assumed I would have to set the remote path to be

When I run the script, the directory is not created (only /home/reviewapp/pullrequest ) and SFTP fails because it can’t find the directory. I suspect SSH commands do not accept variables.

How do I deploy per pull request to a different subfolder?


When you look at the Prepare environment step, is this variable $BUDDY_EXECUTION_PULL_REQUEST_NO set?

Actually, if you could contact and send us the URL to this pipeline, it would be the easiest way for us to help you.