From 02f68cf3c6b93d3b3c29d6b465c557b79718531e Mon Sep 17 00:00:00 2001
From: Jens Meinecke <3967118-meinjens@users.noreply.gitlab.com>
Date: Wed, 7 Dec 2022 21:04:55 +0100
Subject: [PATCH] (22): ci: run review only in merge requests

---
 .gitlab-ci.yml | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 45a2c99..d0c86a3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,6 +1,6 @@
 workflow:
   rules:
-    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
+    - if: $CI_MERGE_REQUEST_ID
     - if: $CI_COMMIT_TAG
     - if: $CI_COMMIT_REF_PROTECTED
 
@@ -20,9 +20,9 @@ stages:
 deploy_review:
   extends: .build
   rules:
-    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
-      when: never
-    - when: always
+    - if: $CI_MERGE_REQUEST_ID
+      when: on_success
+    - when: never
   variables:
     URL: "https://$CI_PROJECT_NAMESPACE.gitlab.io"
     BASE_URL: "/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/"
@@ -39,4 +39,4 @@ pages:
     BASE_URL: "/"
   environment:
     name: production
-    url: "https://codementors.de"
\ No newline at end of file
+    url: "https://codementors.de"
-- 
GitLab