Error running jq command in Drone that works in my local shell

I’m trying to run a jq command within one of the steps in my Drone pipeline. The command converts a JSON key/value pair (that is stored in an Env Var) to a plain ‘key=value’ string.

This works locally:

$ export TEST='{"foo": "bar"}'
$ jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' <(echo ${TEST})

Within my drone pipeline I have the following (simplified for clarity):

kind: pipeline
type: kubernetes
name: matrix-1

  os: linux
  arch: amd64

  - name: some_step
    image: alpine:latest
      - apk add jq
      - jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' <(echo $${TEST})
        from_secret: TEST

Unfortunately, this results in an error from Drone:

+ jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' <(echo ${TEST})

/bin/sh: syntax error: unexpected "("

Clearly, there is something in that command that needs escaping for Drone to correctly process and execute the command.

Does anyone have any pointers?