diff --git a/check_pipeline_status.py b/check_pipeline_status.py
index 71eb0cd7cb9f5b2a6537da71d2be3cb298a5cbd2..8c0ebe987fd5d1167d500538a3e36f8a7049a5a8 100755
--- a/check_pipeline_status.py
+++ b/check_pipeline_status.py
@@ -9,11 +9,13 @@ from gitlab import Gitlab, GitlabGetError
 from gitlab.v4.objects import Project
 
 
-def check_pipeline_status(project: Project, commit):
+def check_pipeline_status(project: Project, commit, source):
     """Get latest pipeline status for a given commit"""
 
     # Find pipeline for commit
-    pipelines = project.pipelines.list(sha=commit, retry_transient_errors=True)
+    pipelines = project.pipelines.list(
+        sha=commit, source=source, retry_transient_errors=True
+    )
     if not pipelines:
         print("ERROR: no pipeline for commit '%s' found" % commit)
         sys.exit(1)
@@ -58,13 +60,21 @@ def main():
         dest="commit",
         required=True,
     )
+    parser.add_argument(
+        "--source",
+        help="""source that triggered the pipeline""",
+        choices=["push", "merge_request_event"],
+        dest="source",
+        default="push",
+        required=False,
+    )
 
     args, _ = parser.parse_known_args()
 
     gitlab = Gitlab(args.gitlab_url, private_token=args.token)
     project = common.get_project(gitlab, args.project)
 
-    status = check_pipeline_status(project, args.commit)
+    status = check_pipeline_status(project, args.commit, args.source)
 
     # If we are running in a job environment and the upstream status is canceled,
     # explicitly cancel this job as well