Skip to content

Commit 0c4e956

Browse files
committed
fix(sdk-review): check-pr-size PR-SIZE-05 git log pipefail guard
git log BASE..HEAD fails when HEAD_SHA is a PR ref not present in the local checkout; under set -e/pipefail that killed the whole check (invalid JSON, aggregate skipped it). Wrap in { … || true; }.
1 parent 14eac0d commit 0c4e956

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.claude/scripts/check-pr-size.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ if [ "$mods_count" -gt 3 ]; then
5656
fi
5757

5858
# PR-SIZE-05: > 30 commits (exclude merge commits by looking at parents)
59-
commit_count=$(git log "${BASE_SHA}..${HEAD_SHA}" --no-merges --oneline 2>/dev/null | wc -l | tr -d ' ')
59+
commit_count=$({ git log "${BASE_SHA}..${HEAD_SHA}" --no-merges --oneline 2>/dev/null || true; } | wc -l | tr -d ' ')
6060
if [ "$commit_count" -gt 30 ]; then
6161
emit_finding "PR-SIZE-05" "FLAG" "." 1 \
6262
"PR has $commit_count commits (>30) — consider squashing or splitting" "" >> "$findings"

0 commit comments

Comments
 (0)