feat: proxy github api

This commit is contained in:
VaalaCat 2024-01-04 14:26:47 +08:00
parent 0743df237e
commit 6260b492fc

View File

@ -75,7 +75,7 @@ EOF
echo_latest_version() {
if [ "${EDGE-}" ]; then
version="$(curl -fsSL https://api.github.com/repos/coder/code-server/releases | awk 'match($0,/.*"html_url": "(.*\/releases\/tag\/.*)".*/)' | head -n 1 | awk -F '"' '{print $4}')"
version="$(curl -fsSL https://proxy.worker.vaala.cloud/https://api.github.com/repos/coder/code-server/releases | awk 'match($0,/.*"html_url": "(.*\/releases\/tag\/.*)".*/)' | head -n 1 | awk -F '"' '{print $4}')"
else
# https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c#gistcomment-2758860
version="$(curl -fsSLI -o /dev/null -w "%{url_effective}" https://ghproxy.com/https://github.com/coder/code-server/releases/latest)"