From c4e223c7a03d0cdf5de1d7feed92b369985df90b Mon Sep 17 00:00:00 2001 From: Liam Cervante Date: Tue, 9 Aug 2022 16:50:54 +0100 Subject: [PATCH] Only perform the importscheck on added or modified files (#31605) --- scripts/goimportscheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/goimportscheck.sh b/scripts/goimportscheck.sh index 7e46518324..f80e4a68fe 100755 --- a/scripts/goimportscheck.sh +++ b/scripts/goimportscheck.sh @@ -2,7 +2,7 @@ # Check goimports echo "==> Checking the code complies with goimports requirements..." -target_files=$(git diff --name-only origin/main | grep "\.go") +target_files=$(git diff --name-only origin/main --diff-filter=MA | grep "\.go") if [[ -z ${target_files} ]]; then exit 0