ssh-run unable to export secure variable

jsultana December 24, 2022

ssh-run version: 0.4.1

 

```

- step:
name: Set environment variables (test)
deployment: test
script:
- echo "Setting environment variables"
- pipe: atlassian/ssh-run:0.4.1
variables:
SSH_USER: '<omitted>'
SERVER: '<omitted>'
COMMAND: 'echo "Branch: \$BRANCH, Commit: \$COMMIT, Env: \$ASPNETCORE_ENVIRONMENT, Conn: \$CONNECTION_STRING" > test.txt'
MODE: 'command'
DEBUG: 'true'
ENV_VARS: >-
BRANCH=${BITBUCKET_BRANCH}
COMMIT=${BITBUCKET_COMMIT}
ASPNETCORE_ENVIRONMENT=${ENVIRONMENT}
CONNECTION_STRING=${CONNECTION_STRING}

```

I have a secured variable (CONNECTION_STRING) defined in my deployments section in repository settings. I'd like to export this secured variable to the remote server using ssh-run. Currently I'm just testing that the environment variables are received correctly. This works when CONNECTION_STRING is not a secured variable, but fails when it's secured. The error I get is:

`bash: Allow: command not found`

Is this by design? I expected that the secured variable won't appear in the logs, but should still be exportable / usable.

1 answer

1 accepted

0 votes
Answer accepted
jsultana December 24, 2022

Actually, looks like my connection string had an "Allow user variables" directive that wasn't being escaped. That's likely what it's complaining about. False alarm :) 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events