Improve update script with redirection support and robustness.

This commit is contained in:
2026-01-09 02:18:38 +00:00
committed by GitHub
parent 467f2f6a1a
commit 55d837beb0

View File

@ -4,7 +4,7 @@ TEMP_JSON=$(mktemp)
trap 'rm -f "$TEMP_JSON"' EXIT trap 'rm -f "$TEMP_JSON"' EXIT
API_URL="https://api.github.com/repos/jenkinsci/docker-agent/releases/latest" API_URL="https://api.github.com/repos/jenkinsci/docker-agent/releases/latest"
HTTP_CODE=$(curl -s -o "$TEMP_JSON" -w "%{http_code}" "$API_URL") HTTP_CODE=$(curl -fsL -o "$TEMP_JSON" -w "%{http_code}" "$API_URL")
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Error: Network request failed." echo "Error: Network request failed."
exit 1 exit 1