'Gitlab-ci rules don't trigger the pipeline again when I create the MR, but get source pipeline sonar results on MR page

I have some feature(side) branche. When I trigger the feature branch pipeline my pipeline running some multi stage (build, tests, sonar-scan). After all those development I would like to create MR to main.

My main expectation is: When I created MR to main. I don't want to see retriggered pipeline for MR. Just bring the sonar results from latest feature branch pipeline to the MR page as a comment. Shortly I want to see feature branch pipeline results on MR page comments.

My code like below, I have already exist multiple rules and I also want to add this one too.

    deploy:
      stage: deployment
      rules:
        - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
          when: never
        - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
          when: never
        - if: '$CI_COMMIT_TAG'
          when: never
        - if: '$CI_COMMIT_BRANCH'
        - when: never


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source