"drone exec" does not support global pipeline variables

Following pipeline(docker pipeline as requested by docs should be supported):

kind: pipeline
type: docker
name: default
platform:
  os: linux

environment:
  TEST: test

steps:
  - name: test
    image: alpine
    commands:
      - echo $${TEST}

Follows syntax as described in Syntax | Drone

But running it locally gives following output:

alex@alex-latop:~/test/drone bug test$ drone exec
[test:0] + echo ${TEST}
[test:1] 

Expected: Environment variable is in output

Workaround: set it per step instead of per pipeline

alex@alex-latop:~/test/drone bug test$ drone --version
drone version 1.2.4

I also stumbled over this over a year ago. Would like to see this fixed, too.

the problem is that drone exec uses the old drone/drone-yaml and drone/drone-runtime libraries which lacks the global environment variable feature. These libraries were deprecated and are no longer being used by the Docker runner. The solution is to upgrade drone exec to use drone-runners/drone-runner-docker as opposed to the previously mentioned libraries.

So tldr the feature works fine when the Docker runner is running your pipeline, but not when you are running locally with drone exec