File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 4040
4141echo " Merge base: $MERGE_BASE "
4242
43+ # Define the files to exclude
44+ EXCLUDE_PATTERN=" **/verification-metadata.xml"
45+
4346# Print the diff statistics from merge base to HEAD (only your changes)
44- echo " Diff statistics from merge base to HEAD (PR changes only):"
45- git diff --stat " $MERGE_BASE " ..HEAD
47+ echo " Diff statistics from merge base to HEAD (PR changes only), excluding $EXCLUDE_PATTERN :"
48+ git diff --stat " $MERGE_BASE " ..HEAD -- . " :(exclude) $EXCLUDE_PATTERN "
4649
4750# Get the total number of lines changed in the PR from the merge base
48- CHANGED_LINES=$( git diff --stat " $MERGE_BASE " ..HEAD | tail -n1 | awk ' {print $4 + $6 }' )
51+ CHANGED_LINES=$( git diff --numstat " $MERGE_BASE " ..HEAD -- . " :(exclude) $EXCLUDE_PATTERN " | awk ' {s+=$1; s+=$2} END {print s }' )
4952
5053# Handle cases where no changes are detected
5154if [[ -z " $CHANGED_LINES " ]]; then
@@ -59,4 +62,4 @@ if [[ "$CHANGED_LINES" -gt "$MAX_LINES" ]]; then
5962fi
6063
6164echo " PR size is acceptable: $CHANGED_LINES lines changed."
62- exit 0
65+ exit 0
You can’t perform that action at this time.
0 commit comments