diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 469bb01f7aa22b46fa0ab152ccd328020267ce9e..bfdd9538651e44334be1ffddaa5ddcbec92c4605 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -40,6 +40,7 @@ check-pipeline-status:
           echo "No successful pipeline found. Triggering new pipeline..."
           curl --request POST --form "token=$CI_JOB_TOKEN" \
                               --form ref=$CI_COMMIT_BRANCH \
+                              --form "variables[CI_TEST_AGAINST_LAST_SUCCESSFUL]=true" \
                               "https://git.iws.uni-stuttgart.de/api/v4/projects/31/trigger/pipeline"
       else
           echo "Found successful pipeline for the current state of the branch. Not testing again."
@@ -63,6 +64,7 @@ check-pipeline-status:
     TRIGGER_SOURCE: $CI_PIPELINE_SOURCE
     COMMIT_BRANCH: $CI_COMMIT_BRANCH
     MR_TARGET_BRANCH_NAME: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
+    TEST_AGAINST_LAST_SUCCESSFUL: $CI_TEST_AGAINST_LAST_SUCCESSFUL
   rules:
   - if: $CI_PIPELINE_SOURCE == "schedule"
     when: always
diff --git a/.gitlab-ci/default.yml b/.gitlab-ci/default.yml
index dead4f5db96f2f0b8bdae5895cfead2be4fd825b..3783d27951d1125c2e8a85a7bc3b1f32cf1368c1 100644
--- a/.gitlab-ci/default.yml
+++ b/.gitlab-ci/default.yml
@@ -34,9 +34,8 @@ select tests:
           echo "Skipping test selection, build/test stages will consider all tests!"
           touch affectedtests.json
 
-      elif [[ "$TRIGGER_SOURCE" == "pipeline" ]]; then
-          echo "Starting pipeline triggered from another pipeline"
-          echo "Determining sha with the last successful pipeline to test against"
+      elif [ -n $TEST_AGAINST_LAST_SUCCESSFUL ]; then
+          echo "Determining sha of the last successful pipeline to test against"
           curl --header --form "token=$CI_JOB_TOKEN" \
                         "https://git.iws.uni-stuttgart.de/api/v4/projects/31/pipelines/?status=success" \
                         > pipeline_status.json