Skip to content

Commit ac9c768

Browse files
authored
Merge pull request #268 from igerber/fix/ai-review-input-limit
Exclude large data files from AI review diff
2 parents 1f6ade8 + ac81cf2 commit ac9c768

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/ai_pr_review.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,20 @@ jobs:
147147
echo "Changed files:"
148148
git --no-pager diff --name-status "$BASE_SHA" "$HEAD_SHA"
149149
echo ""
150+
# Identify large data files excluded from the unified diff
151+
EXCLUDED_GLOBS="benchmarks/data/real/*.json benchmarks/data/real/*.csv"
152+
excluded_files=$(git --no-pager diff --name-only "$BASE_SHA" "$HEAD_SHA" -- $EXCLUDED_GLOBS)
153+
if [ -n "$excluded_files" ]; then
154+
echo "NOTE: The following files are excluded from the unified diff below"
155+
echo "due to size (they are generated data/golden-value files). Their"
156+
echo "filenames appear in the 'Changed files' list above, but their"
157+
echo "content is NOT shown. Review coverage for these files is metadata-only."
158+
echo "$excluded_files" | sed 's/^/ - /'
159+
echo ""
160+
fi
150161
echo "Unified diff (context=5):"
151-
git --no-pager diff --unified=5 "$BASE_SHA" "$HEAD_SHA"
162+
git --no-pager diff --unified=5 "$BASE_SHA" "$HEAD_SHA" \
163+
-- . ':!benchmarks/data/real/*.json' ':!benchmarks/data/real/*.csv'
152164
} >> "$PROMPT"
153165
154166
- name: Run Codex

0 commit comments

Comments
 (0)