Skip to content

Commit fad1c55

Browse files
author
MarcoFalke
committed
lint: Skip COMMIT_RANGE if no CIRRUS_PR
1 parent fa5752d commit fad1c55

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

ci/lint/06_script.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ export LC_ALL=C
99
GIT_HEAD=$(git rev-parse HEAD)
1010
if [ -n "$CIRRUS_PR" ]; then
1111
COMMIT_RANGE="${CIRRUS_BASE_SHA}..$GIT_HEAD"
12+
echo
13+
git log --no-merges --oneline "$COMMIT_RANGE"
14+
echo
1215
test/lint/commit-script-check.sh "$COMMIT_RANGE"
16+
else
17+
COMMIT_RANGE="SKIP_EMPTY_NOT_A_PR"
1318
fi
1419
export COMMIT_RANGE
1520

@@ -34,8 +39,3 @@ if [ "$CIRRUS_REPO_FULL_NAME" = "bitcoin/bitcoin" ] && [ "$CIRRUS_PR" = "" ] ; t
3439
${CI_RETRY_EXE} gpg --keyserver hkps://keys.openpgp.org --recv-keys "${KEYS[@]}" &&
3540
./contrib/verify-commits/verify-commits.py;
3641
fi
37-
38-
if [ -n "$COMMIT_RANGE" ]; then
39-
echo
40-
git log --no-merges --oneline "$COMMIT_RANGE"
41-
fi

test/lint/lint-git-commit-check.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ def main():
4646
commit_range = merge_base + "..HEAD"
4747
else:
4848
commit_range = os.getenv("COMMIT_RANGE")
49+
if commit_range == "SKIP_EMPTY_NOT_A_PR":
50+
sys.exit(0)
4951

5052
commit_hashes = check_output(["git", "log", commit_range, "--format=%H"], universal_newlines=True, encoding="utf8").splitlines()
5153

test/lint/lint-whitespace.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ def main():
9797
commit_range = merge_base + "..HEAD"
9898
else:
9999
commit_range = os.getenv("COMMIT_RANGE")
100+
if commit_range == "SKIP_EMPTY_NOT_A_PR":
101+
sys.exit(0)
100102

101103
whitespace_selection = []
102104
tab_selection = []

0 commit comments

Comments
 (0)