[solved] Promote issue,the environment condition not work

Not sure if it is a bug,yml this

kind: pipeline
type: docker
name: Deployment

steps:
  - name: deploy
    image: appleboy/drone-ssh
    settings:
      host: some-host
      port: 22
      username: 
        from_secret: production_env_user
      password:
        from_secret: production_env_pass
      script:
        - echo ${DRONE_REPO} ${DRONE_REPO_NAME} ${DRONE_BUILD_NUMBER}
    when:
      environment: 
        - production

trigger:
  branch:
    - master
  event:
    - promote
    - rollback
  target:
    - development
    - staging
    - production

But if I trigger with UI promote,input with staging

the result,also pass deploy step,the condition

    when:
      environment: 
        - production

not work?

The when.environment attribute does not exist. Instead you should use when.target which is the correct attribute per the official documentation [1][2]

    when:
-     environment: 
-       - production
+     environment: 
+       - production

[1] https://docs.drone.io/pipeline/docker/syntax/conditions/#by-target
[2] https://docs.drone.io/promote/#how-it-works