Why push cannot work?

hello,
I used Gitlab and drone.
I just started using the Drone.
I ran into two problems.

  1. when I push, the drone cannot work. but the tag and merge request events works,
    Why is it happen? and how should I let push work?

  2. when I trigger tag or merge request events.
    SCP-stage step show :
    Error: can't connect without a private SSH key or password
    but when I create a New Build manual, its works.

Thank you very much.

.drone.yml

    kind: pipeline
    name: default

    steps:
    - name: stage
      image: php:7.3
      commands:
      - php -v
      - php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
      - php composer-setup.php --install-dir=/usr/local/bin --filename=composer
      - chmod +x /usr/local/bin/composer
      - composer -V
      - rm -rf .git .drone.yml README.md composer-setup.php
      - ls -al
      when:
        branch:
        - develop
        - master
    - name: scp-stage
      image: appleboy/drone-scp
      settings:
        host: 127.0.0.1
        user: root
        port: 22
        password:
          from_secret: stage_125_password
        target: /home/www/ci-demo
        source: 
          - ./*
      when:
        branch:
        - develop
    - name: scp-live
      image: appleboy/drone-scp
      settings:
        host: 127.0.0.1
        user: root
        port: 22
        password:
          from_secret: stage_125_password
        target: /home/www/ci-demo-live
        source: 
          - ./*
      when:
        branch:
        - master
  

gitlab hooks:

@Icarus ,

Could you please confirm below things:

  1. Does push is enabled under webhook for the repository in gitlab that is being used here
  2. Looks like you are using repository password stage_125_password, so could you please confirm if you have created on drone repo

Regard,
Harness Support

We have a dedicated thread for this that you can use to triage. See ENV: get source branch

hello,
sorry for the late reply
about 1, If I create a new git repository, it works normally, I don’t know why that repository cannot work.
about 2, it has an option when creating secrets Allow Pull Requests, so it cannot work.
Thank you~