Skip to content
6 changes: 4 additions & 2 deletions dev_tools/ci/size-labeler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ declare -A LIMITS=(
["${LABELS[4]}"]="$((2 ** 63 - 1))"
)

# Note: these are Bash glob patterns and not regexes.
declare -ar IGNORED=(
"*_pb2.py"
"*_pb2.pyi"
Expand Down Expand Up @@ -114,7 +115,7 @@ function compute_changes() {
local response
local change_info
local -r keys_filter='with_entries(select([.key] | inside(["changes", "filename"])))'
response="$(api_call "pulls/${pr}/files")"
response="$(api_call "pulls/${pr}/files?per_page=100")"
Comment thread
mhucka marked this conversation as resolved.
Outdated
change_info="$(jq_stdin "map(${keys_filter})" <<<"${response}")"

local files total_changes
Expand All @@ -124,7 +125,8 @@ function compute_changes() {
local name changes
name="$(jq_stdin -r '.filename' <<<"${file}")"
for pattern in "${IGNORED[@]}"; do
if [[ "$name" =~ ${pattern} ]]; then
# shellcheck disable=SC2053 # Pattern must be left unquoted here.
if [[ "$name" == ${pattern} ]]; then
info "File $name ignored"
continue 2
fi
Expand Down
Loading