From 9960495da27aa6b00d62d40862c99c7d61a20672 Mon Sep 17 00:00:00 2001 From: Silia Taider Date: Tue, 3 Feb 2026 16:42:24 +0100 Subject: [PATCH] [ci] Apply last-2-commits diff logic to ruff formatting --- .github/workflows/code_analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_analysis.yml b/.github/workflows/code_analysis.yml index caf0f89c3f0e2..c3229ee70e32d 100644 --- a/.github/workflows/code_analysis.yml +++ b/.github/workflows/code_analysis.yml @@ -96,7 +96,7 @@ jobs: end=$((start + length)) diff_command+="ruff format --diff --range $start-$end $file && " apply_command+="ruff format --range $start-$end $file && " - done < <(git diff --unified=0 origin/$GITHUB_BASE_REF "$file" | grep '^@@' | sed -E 's/^@@ -[0-9]+(,[0-9]+)? \+([0-9]+)(,([0-9]+))? @@.*/\2-\4/') + done < <(git diff --unified=0 HEAD~1 -- "$file" | grep '^@@' | sed -E 's/^@@ -[0-9]+(,[0-9]+)? \+([0-9]+)(,([0-9]+))? @@.*/\2-\4/') done if [ -n "$diff_command" ]; then