79469230

Date: 2025-02-26 09:48:36
Score: 1.5
Natty:
Report link

Since there are not many details about your code quality process, I will focus on your question:

Is it possible to somehow setup rules, to run branch pipeline only for MR and for default branch?

I think job rules may be something like this:

  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
    - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
      when: always
    - when: never

This set of rules uses GitLab environment variables like:

Please experiment with them.

Reasons:
  • Blacklisted phrase (1): Is it possible to
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Kynes