From fa5cbf2290dab08296cabbd973e9adefc883f3fc Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Mon, 2 Jan 2023 14:08:07 +0100 Subject: [PATCH] ci: Properly set COMMIT_RANGE in lint task --- .cirrus.yml | 1 + ci/lint/06_script.sh | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 7bc346cc307..90988a23e5c 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -29,6 +29,7 @@ base_template: &BASE_TEMPLATE - if [ "$CIRRUS_PR" = "" ]; then exit 0; fi - git fetch $CIRRUS_REPO_CLONE_URL "pull/${CIRRUS_PR}/merge" - git checkout FETCH_HEAD # Use merged changes to detect silent merge conflicts + # Also, the merge commit is used to lint COMMIT_RANGE="HEAD~..HEAD" main_template: &MAIN_TEMPLATE timeout_in: 120m # https://cirrus-ci.org/faq/#instance-timed-out diff --git a/ci/lint/06_script.sh b/ci/lint/06_script.sh index a1721a703fb..c14d7473d37 100755 --- a/ci/lint/06_script.sh +++ b/ci/lint/06_script.sh @@ -6,9 +6,8 @@ export LC_ALL=C -GIT_HEAD=$(git rev-parse HEAD) if [ -n "$CIRRUS_PR" ]; then - COMMIT_RANGE="${CIRRUS_BASE_SHA}..$GIT_HEAD" + COMMIT_RANGE="HEAD~..HEAD" echo git log --no-merges --oneline "$COMMIT_RANGE" echo