summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2019-02-19 16:10:16 +0100
committerAndreas Schneider <asn@samba.org>2019-02-20 17:24:01 +0100
commit5cc06814060cd99245e7f072da077e5227d7698d (patch)
treee6d670c46f84ed26bd853ee3bb8a5ee9ac88b085
parent066d850c2853095bf756e7f5e9aeb198f6775b23 (diff)
downloadsocket_wrapper-5cc06814060cd99245e7f072da077e5227d7698d.tar.gz
socket_wrapper-5cc06814060cd99245e7f072da077e5227d7698d.tar.xz
socket_wrapper-5cc06814060cd99245e7f072da077e5227d7698d.zip
gitlab-ci: Check last 20 commits on force push
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--.gitlab-ci.yml4
1 files changed, 2 insertions, 2 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a2bb099..365d834 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -82,12 +82,12 @@ fedora/csbuild:
script:
- |
if [[ -z "$CI_COMMIT_BEFORE_SHA" ]]; then
- export CI_COMMIT_BEFORE_SHA=$(git rev-parse HEAD^)
+ export CI_COMMIT_BEFORE_SHA=$(git rev-parse "${CI_COMMIT_SHA}~20")
fi
# Check if the commit exists in this branch
# This is not the case for a force push
- git branch --contains $CI_COMMIT_BEFORE_SHA 2>/dev/null || export CI_COMMIT_BEFORE_SHA=$(git rev-parse HEAD^)
+ git branch --contains $CI_COMMIT_BEFORE_SHA 2>/dev/null || export CI_COMMIT_BEFORE_SHA=$(git rev-parse "${CI_COMMIT_SHA}~20")
export CI_COMMIT_RANGE="$CI_COMMIT_BEFORE_SHA..$CI_COMMIT_SHA"