Defining workspace attachment point with a variable

I would really like to be able to do something like this:

- attach_workspace:
    at: ${WORKSPACE_MOUNT_PATH}

where the WORKSPACE_MOUNT_PATH variable is defined as part of the executor. I know of no single fixed path string that works on both Linux/Mac and Windows executors because of Windows’ need for a drive letter (e.g. /tmp/workspace vs c://tmp/workspace), so the attach_workspace step can’t be made platform-agnostic. If only it supported environment variable interpolation I could stop doing annoying things like this:

    steps:
      - when:
          condition: << parameters.IS_WINDOWS >>
          steps:
            - attach_workspace:
                at: c:/tmp/workspace
      - unless:
          condition: << parameters.IS_WINDOWS >>
          steps:
            - attach_workspace:
                at: /tmp/workspace

Is there something I’m missing here? More broadly, is there a good reference for where exactly environment variable interpolation works? I have to just try things and find out, which is slow and often surprising. For instance, it seems variables work in docker image: specifications, but not for some reason in workspace paths.

Thanks!

Hi @csosborn
Did you find answer for this? I also want to use environment variable as path. Please let me know if you got it working