Gitlab MR Decoration with Rules instead of Only

  • CI system used: Gitlab
  • Languages of the repository: Java and Python

In order to get merge request decoration working, is it necessary to use the tag:

- merge_requests

In the YML file, or are you able to use an equivalent rule to trigger it? I’ve tested some rules like

- if: $CI_MERGE_REQUEST_ID == null

but haven’t been able to get it working without the only: -merge requests.

1 Like

You have to configure your pipeline to run on MR and not on pushing to feature branches. Having this at the top of my .gitlab-ci.yml file did the trick for me:

    - if: $CI_COMMIT_TAG
    - if: '$CI_COMMIT_BRANCH == "master"'
    - if: '$CI_COMMIT_BRANCH == "devel"'

See also:


Thank you! This was the issue, we had been using feature branches due to this bug

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.