From 7bf7616490ce6fdec4ca343225dd59534d9b73a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= Date: Thu, 25 Sep 2025 10:11:09 +0200 Subject: [PATCH] ci: common: don't run git if we can just get the base sha from gitlab Part-of: --- .ci/lib/common.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.ci/lib/common.py b/.ci/lib/common.py index 4467ef9bd..0f008de5c 100755 --- a/.ci/lib/common.py +++ b/.ci/lib/common.py @@ -98,6 +98,10 @@ def get_base_commit() -> str: """Get the base commit that can be compared with HEAD to get all commits in the given branch/merge request.""" + commit = os.getenv("CI_MERGE_REQUEST_DIFF_BASE_SHA") + if commit is not None: + return commit + branch_upstream = f"upstream/{get_upstream_branch()}" commit_head = run_git(["rev-parse", "HEAD"])[:-1] commit_upstream = run_git(["rev-parse", branch_upstream])[:-1]