fix(optimize-images): fix git implementation of pr diff (#57)

This commit is contained in:
Léa Gris 2026-01-20 12:21:38 +01:00 committed by GitHub
parent be9f21cb0d
commit 2c8beeed8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,8 +25,9 @@ jobs:
echo 'png_files<<EOF'
if [ "${{ github.event_name }}" = pull_request ] &&
[ "${{ !github.event.pull_request.draft }}" = true ]; then
git fetch origin "$GITHUB_BASE_REF" &&
git fetch origin "$GITHUB_BASE_REF" "refs/pull/$PR_NUMBER/head:pr-$PR_NUMBER" &&
git diff --name-only -l10000 "origin/$GITHUB_BASE_REF" "pr-$PR_NUMBER" -- '*.png'
git diff --name-only --diff-filter=AM --no-renames "origin/$GITHUB_BASE_REF" "pr-$PR_NUMBER" -- '*.png'
else
find "$GITHUB_WORKSPACE" -type f -name "*.png" ! -path "$GITHUB_WORKSPACE/.git/*" -print 2>/dev/null
fi