* fetch ref previous commit too * add FETCH_DEPTH value so is more visible
@@ -39,6 +39,8 @@ else
fi
ref=${ref:-HEAD}
+# Ensure that the ref revision has some history
+git fetch -q "--depth=${FETCH_DEPTH:-50}" origin "+${ref}"
src_sha=$(git rev-parse -q --verify "${ref}") || die "fatal: couldn't find ref ${ref}"
echo "Checking $(git rev-list --count "${src_sha}" "^${target_sha}") commits since revision ${target_sha}"
for commit in $(git rev-list --reverse "${src_sha}" "^${target_sha}"); do
@@ -72,6 +72,8 @@ else
@@ -34,6 +34,7 @@ jobs:
run: ./.github/scripts/check-cmake-format.sh
env:
ref: ${{ github.event.pull_request.head.sha }}
+ FETCH_DEPTH: 50
check-commit:
runs-on: ubuntu-latest
permissions:
@@ -47,6 +48,7 @@ jobs:
run: ./.github/scripts/check-commit.sh
build: