This repository was archived by the owner on Aug 10, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,16 +27,18 @@ jobs:
2727 local total=0
2828 for month in $(seq 1 $current_month); do
2929 month_padded=$(printf "%02d" $month)
30- monthly=$(curl -fsSL "https://data.jsdelivr.com/v1/stats/packages/${package}?period=${year}-${month_padded}" | \
31- sed -n -E 's/.*"total":[[:space:]]*([0-9]+).*/\1/p' | head -1)
32- if [ -n "$monthly" ] && [ "$monthly" -gt 0 ]; then
30+ monthly=$(curl -fsSL --proto "=https" \
31+ "https://data.jsdelivr.com/v1/stats/packages/${package}?period=${year}-${month_padded}" | \
32+ sed -n -E 's/.*"total":[[:space:]]*([0-9]+).*/\1/p' | head -1
33+ )
34+ if [ -n "$monthly" ] && [ "$monthly" -gt 0 ] ; then
3335 total=$((total + monthly))
3436 echo " $year-$month_padded: $monthly" >&2
3537 fi
3638 done
3739 echo "$total"
3840 else # get year stats
39- curl -fsSL "https://data.jsdelivr.com/v1/stats/packages/${package}?period=${year}" | \
41+ curl -fsSL --proto "=https" "https://data.jsdelivr.com/v1/stats/packages/${package}?period=${year}" | \
4042 sed -n -E 's/.*"total":[[:space:]]*([0-9]+).*/\1/p' | head -1
4143 fi
4244 }
You can’t perform that action at this time.
0 commit comments