summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorglx22 <glx@openttd.org>2020-12-10 00:31:03 +0100
committerglx22 <glx22@users.noreply.github.com>2020-12-10 01:08:44 +0100
commite2eafd86de01abe0aac06f369c09808c758e025c (patch)
treeedac62d45f7fa2dc37ebf63015bdfdf19effa8e1 /.github
parent20151e41ea0b504f94fab44f729c7c1e6cf88928 (diff)
downloadopenttd-e2eafd86de01abe0aac06f369c09808c758e025c.tar.xz
Fix: Prevent infinite recursion in commit checker
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/commit-checker.yml6
1 files changed, 6 insertions, 0 deletions
diff --git a/.github/workflows/commit-checker.yml b/.github/workflows/commit-checker.yml
index d2546ab30..d83183a46 100644
--- a/.github/workflows/commit-checker.yml
+++ b/.github/workflows/commit-checker.yml
@@ -24,6 +24,12 @@ jobs:
# the log between HEAD^ and HEAD^2 will be the commits in the pull-request.
DEPTH=4
while [ -z "$(git merge-base HEAD^ HEAD^2)" ]; do
+ # Prevent infinite recursion
+ if [ ${DEPTH} -gt 256 ]; then
+ echo "No common parent between '${GITHUB_HEAD_REF}' and '${GITHUB_BASE_REF}'." >&2
+ exit 1
+ fi
+
git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --deepen=${DEPTH} origin HEAD
DEPTH=$(( ${DEPTH} * 4 ))
done