$DRONE_TAG not present on drone exec

Apparently when

drone exec --event tag --ref refs/tags/v2.23.0

and one of my steps make use of the $DRONE_TAG variable, that breaks on drone exec as that variable doesn’t get expanded?

on my .drone.yml I have:

  - name: test
    image: alpine
    commands:
      - env
      - "echo DRONE_TAG: $DRONE_TAG"

But the output for drone exec doesn’t present "$DRONE_TAG which should be v2.23.0

I am running

$ drone --version
drone version 1.4.0

Hello @zanona
Thank you for reaching out to Harness Support. After digging through the docs we believe the cause for this is due to the scope of the variable is not in the “command” phase but present in the “steps” phase.

Please find the below Doc for the ways to substitute it and let is know if this helps ?

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

Thanks & Regards,
Harness Support