From 057306fba1ac26adac68b6e7e9c8c9c5eb08ab53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Sun, 26 Jan 2025 17:34:14 +0100 Subject: [PATCH] ci: use shallow fetch No need to fetch the entire history. The merge base is likely within the last couple commits because we require it to be so anyway, because the repo requires fast-forward merges currently. skip-changelog, because this doesn't touch library code. --- .gitlab-ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 76e1abb4a6a5a68d5a2271a03ba0a575164d1795..8e811cb37254d6a372f2ecbfef2f88f5d6e5b96d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -82,8 +82,13 @@ changelog-update: - apk add --no-cache python3 git - python3 --version - git version - - git fetch origin main - - git log --oneline "${CI_MERGE_REQUEST_DIFF_BASE_SHA}.." -- + - git fetch --depth 16 origin main + - | + if ! git log --oneline "${CI_MERGE_REQUEST_DIFF_BASE_SHA}.." --; then + echo "Failed to find revision ${CI_MERGE_REQUEST_DIFF_BASE_SHA}.." >&2 + echo "This likely means that you need to rebase your branch." >&2 + exit 1 + fi - python3 .forgejo/workflows/check-changelog.py rules: - if: $CI_PIPELINE_SOURCE == 'merge_request_event'