ci: common: don't run git if we can just get the base sha from gitlab
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7078>
This commit is contained in:
parent
1d6eea7261
commit
7bf7616490
1 changed files with 4 additions and 0 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue