Set image variable in previous step

Hi, I’m trying to set up a unity pipeline but for that I need to run 1 step that gets the exact unity version and saves it in a variable. And then another step that uses that variable to pull a specific unity image.
I’m wondering if this is possible in drone somehow?

Here is what I’m trying to achieve:

  IMAGE: unityci/editor

- name: get-unity-version
  image: alpine
  - echo UNITY_VERSION=$(cat $DRONE_WORKSPACE/ProjectSettings/ProjectVersion.txt | grep "m_EditorVersion:.*" | awk '{ print $2}') // Save output to UNITY_VERSION env variable

- name: get-activation-file
  image: $IMAGE:$UNITY_VERSION-base-$IMAGE_VERSION //Use the UNITY_VERSION env variable to download the correct image
  - ...

I just tried hardcoding the unity version (not ideal but it doesn’t change THAT often so it’s doable), but even then it doesn’t work? Looks like the ‘image’ doesn’t accept a combined string?


This gives ‘Error response from daemon: invalid reference format’

Edit 2:
Adding quotes doesn’t work either


Same error as above

You cannot use environment variables in the Yaml like this.

Drone does support variable substitution using ${variable} syntax, however, the substitution occurs before the yaml is parsed. Substitution is also limited to the following list of variables: