1

To keep things short, these are the requirements for workflow of a GitLab CI/CD pipeline

  1. Pipeline should automatically run on MR create event
  2. Pipeline should not run for any commit/push before or after MR is created
Anant_Kumar
  • 764
  • 1
  • 7
  • 23
  • Does this answer your question? [Disable pipeline for every commit in Gitlab and only run it on open merge request](https://stackoverflow.com/questions/51431537/disable-pipeline-for-every-commit-in-gitlab-and-only-run-it-on-open-merge-reques) – Nolequen Jul 25 '22 at 12:03

1 Answers1

-1

In order enable pipeline for merge requests for all jobs, you can make use of workflow:rules.

Here is an example:

workflow:
  rules:
    - if: $CI_MERGE_REQUEST_ID    # Execute jobs in merge request context

build:
  stage: build
  script: ./build

test:
  stage: test
  script: ./test

Sourav
  • 3,025
  • 2
  • 13
  • 29
  • This does not fulfil the requirements. This runs pipeline for every commit after MR is raised. Req -> Pipeline should only run once after MR is raised and NOT run automatically for subsequent commits/pushes – Anant_Kumar Nov 01 '20 at 19:54