limit PR diff size and filter control characters

- Limit the diff to the first 10.000 lines
- Filter out problematic control characters
This commit is contained in:
Ludy87 2025-06-23 21:48:09 +02:00
parent 7437b9ac0c
commit 2543fcf889

View File

@ -66,7 +66,7 @@ jobs:
id: get_diff id: get_diff
run: | run: |
git fetch origin ${{ github.base_ref }} git fetch origin ${{ github.base_ref }}
git diff origin/${{ github.base_ref }}...HEAD > pr.diff git diff origin/${{ github.base_ref }}...HEAD | head -n 10000 | grep -vP '[\x00-\x08\x0B\x0C\x0E-\x1F\x7F\x{202E}\x{200B}]' > pr.diff
echo "diff<<EOF" >> $GITHUB_OUTPUT echo "diff<<EOF" >> $GITHUB_OUTPUT
cat pr.diff >> $GITHUB_OUTPUT cat pr.diff >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT