Skip to content

Commit eec4310

Browse files
committed
[ci] Apply last-2-commits diff logic to ruff formatting
1 parent f8dffa9 commit eec4310

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/code_analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
end=$((start + length))
9797
diff_command+="ruff format --diff --range $start-$end $file && "
9898
apply_command+="ruff format --range $start-$end $file && "
99-
done < <(git diff --unified=0 origin/$GITHUB_BASE_REF "$file" | grep '^@@' | sed -E 's/^@@ -[0-9]+(,[0-9]+)? \+([0-9]+)(,([0-9]+))? @@.*/\2-\4/')
99+
done < <(git diff --unified=0 HEAD~1 -- "$file" | grep '^@@' | sed -E 's/^@@ -[0-9]+(,[0-9]+)? \+([0-9]+)(,([0-9]+))? @@.*/\2-\4/')
100100
done
101101
102102
if [ -n "$diff_command" ]; then

0 commit comments

Comments
 (0)