File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ echo "Configuring target diff for event: $EVENT_NAME"
1212# Determine the base branch/commit to diff against
1313if [ " $EVENT_NAME " = " pull_request" ]; then
1414 # Ensure we have the target branch metadata fetched.
15- # Note: If this fails due to shallow clone issues, the script will exit safely via set -e
1615 git fetch origin " $BASE_REF " --depth=1 --quiet
1716 BASE_SHA=" origin/$BASE_REF "
1817else
2322 fi
2423fi
2524
26- # Extract changed Python files into a Bash array
27- mapfile -t CHANGED_FILES < <( git diff --name-only --diff-filter=d " $BASE_SHA " -- ' *.py' 2> /dev/null || true)
25+ DIFF_OUTPUT=$( git diff --name-only --diff-filter=d " $BASE_SHA " -- ' *.py' 2> /dev/null || true)
26+
27+ if [ -n " $DIFF_OUTPUT " ]; then
28+ mapfile -t CHANGED_FILES <<< " $DIFF_OUTPUT"
29+ else
30+ CHANGED_FILES=()
31+ fi
2832
2933# Execute linters if files exist
3034if [ ${# CHANGED_FILES[@]} -gt 0 ]; then
@@ -45,3 +49,4 @@ if [ ${#CHANGED_FILES[@]} -gt 0 ]; then
4549 fi
4650else
4751 echo " ✅ No Python files changed in this scope. Skipping checks."
52+ fi
You can’t perform that action at this time.
0 commit comments