Is there anyway to trigger branch or condition branch from secret?

Hello, I have a requirements as follow:
We have two cluster, dev and prod, and our team appointed:
develop branch -(deploy to )-> dev env -(use)-> drone.dev.domain.com
master branch -(deploy to)-> prod env -(use)-> drone.prod.domain.com
My questions is how to trigger branch from secret, like:

trigger:
  environment:
    BUILD_BRANCH: 
      from_secret: build_branch
  branch:
  - ${BUILD_BRANCH}

build_branch is a secret i configured as develop or master, I know i can use different .drone.yml whit conditions in between this two branches. However, when i merge branch or create PR, the .drone.yml will be overridden.

I have tried to config .drone.yml like this:

steps:
  - name: build
    image: node
    environment:
      BUILD_BRANCH: 
        from_secret: build_branch
    commands: 
      - yarn install
    when:
      branch:
        - ${BUILD_BRANCH}

It seems that it can’t works. What should i do? Thanks.

My questions is how to trigger branch from secret

This is not possible. The from_secret syntax cannot be used in the trigger section as shown in your first example. It can only be used in the environment or settings section of a step.

In terms of the second example, only environment variables in this list can be substituted, and the substitution happens before the yaml is parsed.