Skip to content
This repository was archived by the owner on Aug 10, 2026. It is now read-only.

Commit a0faa7f

Browse files
author
Adam Lui
committed
Enforced https
1 parent 8a68937 commit a0faa7f

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

.github/workflows/update-jsd-shields-weekly.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)