Use secret inside script

I set up the target directory for rsync in a secret and would like to use the path in a script afterwards:

steps:
- name: rsync
  image: drillster/drone-rsync
  settings:
    …
    target:
      from_secret: remote_target
    script:
      - bash ${remote_target}/run.sh

It obviously does not work this way in Drone though, as the secret does not seem to be an environment variable. Is there a way to use secrets other than the from_secret: remote_target way?

@mcnesium,

As mentioned in doc could you please try to construct the variable in command section
“Also note the environment section cannot expand environment variables or evaluate shell expressions. If you need to construct variables it should be done in the commands section”

https://docs.drone.io/pipeline/environment/syntax/