File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,14 +39,6 @@ declare -A LIMITS=(
3939 [" ${LABELS[4]} " ]=" $(( 2 ** 63 - 1 )) "
4040)
4141
42- declare -ar IGNORED=(
43- " *_pb2.py"
44- " *_pb2.pyi"
45- " *_pb2_grpc.py"
46- " .*.lock"
47- " *.bundle.js"
48- )
49-
5042function info() {
5143 echo >&2 " INFO: ${* } "
5244}
@@ -111,30 +103,19 @@ function api_call() {
111103function compute_changes() {
112104 local -r pr=" $1 "
113105 local page=1
114- local total_changes =0
106+ local changes =0
115107 while true ; do
116108 local response
117109 response=" $( api_call " pulls/${pr} /files?per_page=100&page=${page} " ) "
118110
119- if [[ " $( jq_stdin ' . | length' <<< " ${response}" ) " -eq 0 ]]; then
111+ if [[ " $( jq_stdin ' length' <<< " ${response}" ) " -eq 0 ]]; then
120112 break
121113 fi
122114
123- local name changes
124- while IFS= read -r name && IFS= read -r changes; do
125- for pattern in " ${IGNORED[@]} " ; do
126- # shellcheck disable=SC2053 # Need leave the pattern unquoted.
127- if [[ " ${name} " == ${pattern} ]]; then
128- info " File ${name} ignored"
129- continue 2
130- fi
131- done
132- info " File ${name} +-${changes} "
133- total_changes=" $(( total_changes + changes)) "
134- done < <( jq_stdin -r ' .[] | .filename, .changes' <<< " ${response}" )
115+ changes=$(( changes + $(jq_stdin '[0 , .[].changes] | add' <<< "${response} ")) )
135116 (( page++ ))
136117 done
137- echo " ${total_changes } "
118+ echo " ${changes } "
138119}
139120
140121function get_size_label() {
You can’t perform that action at this time.
0 commit comments