From 80abd4a36bd53a77e030acea9abff59e97c7e85b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Feb 2026 06:29:02 +0000 Subject: [PATCH 1/5] Initial plan From 1e325acfc431d4cf6939a3b057c896fc1f2f4435 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Feb 2026 06:37:29 +0000 Subject: [PATCH 2/5] Add --retry 3 to curl downloads in install scripts to handle transient 502 errors Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/sh/install_awf_binary.sh | 6 +++--- actions/setup/sh/install_copilot_cli.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/actions/setup/sh/install_awf_binary.sh b/actions/setup/sh/install_awf_binary.sh index ff92b45e24..754797849f 100755 --- a/actions/setup/sh/install_awf_binary.sh +++ b/actions/setup/sh/install_awf_binary.sh @@ -61,7 +61,7 @@ trap 'rm -rf "$TEMP_DIR"' EXIT # Download checksums echo "Downloading checksums from ${CHECKSUMS_URL@Q}..." -curl -fsSL -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}" +curl -fsSL --retry 3 -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}" verify_checksum() { local file="$1" @@ -99,7 +99,7 @@ install_linux_binary() { local binary_url="${BASE_URL}/${awf_binary}" echo "Downloading binary from ${binary_url@Q}..." - curl -fsSL -o "${TEMP_DIR}/${awf_binary}" "${binary_url}" + curl -fsSL --retry 3 -o "${TEMP_DIR}/${awf_binary}" "${binary_url}" # Verify checksum verify_checksum "${TEMP_DIR}/${awf_binary}" "${awf_binary}" @@ -124,7 +124,7 @@ install_darwin_binary() { local binary_url="${BASE_URL}/${awf_binary}" echo "Downloading binary from ${binary_url@Q}..." - curl -fsSL -o "${TEMP_DIR}/${awf_binary}" "${binary_url}" + curl -fsSL --retry 3 -o "${TEMP_DIR}/${awf_binary}" "${binary_url}" # Verify checksum verify_checksum "${TEMP_DIR}/${awf_binary}" "${awf_binary}" diff --git a/actions/setup/sh/install_copilot_cli.sh b/actions/setup/sh/install_copilot_cli.sh index 3a508e19ea..7c8d11c20c 100755 --- a/actions/setup/sh/install_copilot_cli.sh +++ b/actions/setup/sh/install_copilot_cli.sh @@ -87,11 +87,11 @@ trap 'rm -rf "$TEMP_DIR"' EXIT # Download checksums echo "Downloading checksums from ${CHECKSUMS_URL}..." -curl -fsSL -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}" +curl -fsSL --retry 3 -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}" # Download binary tarball echo "Downloading binary from ${TARBALL_URL}..." -curl -fsSL -o "${TEMP_DIR}/${TARBALL_NAME}" "${TARBALL_URL}" +curl -fsSL --retry 3 -o "${TEMP_DIR}/${TARBALL_NAME}" "${TARBALL_URL}" # Verify checksum echo "Verifying SHA256 checksum for ${TARBALL_NAME}..." From 51dbc49e53b0d61338323a15056d125d444ebac0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Feb 2026 06:46:04 +0000 Subject: [PATCH 3/5] Replace --retry 3 with curl_with_retry helper implementing exponential backoff Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/sh/install_awf_binary.sh | 25 ++++++++++++++++++++++--- actions/setup/sh/install_copilot_cli.sh | 23 +++++++++++++++++++++-- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/actions/setup/sh/install_awf_binary.sh b/actions/setup/sh/install_awf_binary.sh index 754797849f..4cf6390ade 100755 --- a/actions/setup/sh/install_awf_binary.sh +++ b/actions/setup/sh/install_awf_binary.sh @@ -59,9 +59,28 @@ sha256_hash() { TEMP_DIR=$(mktemp -d) trap 'rm -rf "$TEMP_DIR"' EXIT +# Download a URL to a file with exponential backoff retry (3 attempts: 0s, 5s, 10s) +curl_with_retry() { + local url="$1" + local output="$2" + local delay=5 + for attempt in 1 2 3; do + if curl -fsSL -o "$output" "$url"; then + return 0 + fi + if [ "$attempt" -lt 3 ]; then + echo "Download attempt $attempt failed, retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 2)) + fi + done + echo "ERROR: Failed to download ${url} after 3 attempts" + return 1 +} + # Download checksums echo "Downloading checksums from ${CHECKSUMS_URL@Q}..." -curl -fsSL --retry 3 -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}" +curl_with_retry "${CHECKSUMS_URL}" "${TEMP_DIR}/checksums.txt" verify_checksum() { local file="$1" @@ -99,7 +118,7 @@ install_linux_binary() { local binary_url="${BASE_URL}/${awf_binary}" echo "Downloading binary from ${binary_url@Q}..." - curl -fsSL --retry 3 -o "${TEMP_DIR}/${awf_binary}" "${binary_url}" + curl_with_retry "${binary_url}" "${TEMP_DIR}/${awf_binary}" # Verify checksum verify_checksum "${TEMP_DIR}/${awf_binary}" "${awf_binary}" @@ -124,7 +143,7 @@ install_darwin_binary() { local binary_url="${BASE_URL}/${awf_binary}" echo "Downloading binary from ${binary_url@Q}..." - curl -fsSL --retry 3 -o "${TEMP_DIR}/${awf_binary}" "${binary_url}" + curl_with_retry "${binary_url}" "${TEMP_DIR}/${awf_binary}" # Verify checksum verify_checksum "${TEMP_DIR}/${awf_binary}" "${awf_binary}" diff --git a/actions/setup/sh/install_copilot_cli.sh b/actions/setup/sh/install_copilot_cli.sh index 7c8d11c20c..5862ba1a96 100755 --- a/actions/setup/sh/install_copilot_cli.sh +++ b/actions/setup/sh/install_copilot_cli.sh @@ -81,17 +81,36 @@ sha256_hash() { fi } +# Download a URL to a file with exponential backoff retry (3 attempts: 0s, 5s, 10s) +curl_with_retry() { + local url="$1" + local output="$2" + local delay=5 + for attempt in 1 2 3; do + if curl -fsSL -o "$output" "$url"; then + return 0 + fi + if [ "$attempt" -lt 3 ]; then + echo "Download attempt $attempt failed, retrying in ${delay}s..." + sleep "$delay" + delay=$((delay * 2)) + fi + done + echo "ERROR: Failed to download ${url} after 3 attempts" + return 1 +} + # Create temp directory with cleanup on exit TEMP_DIR=$(mktemp -d) trap 'rm -rf "$TEMP_DIR"' EXIT # Download checksums echo "Downloading checksums from ${CHECKSUMS_URL}..." -curl -fsSL --retry 3 -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}" +curl_with_retry "${CHECKSUMS_URL}" "${TEMP_DIR}/SHA256SUMS.txt" # Download binary tarball echo "Downloading binary from ${TARBALL_URL}..." -curl -fsSL --retry 3 -o "${TEMP_DIR}/${TARBALL_NAME}" "${TARBALL_URL}" +curl_with_retry "${TARBALL_URL}" "${TEMP_DIR}/${TARBALL_NAME}" # Verify checksum echo "Verifying SHA256 checksum for ${TARBALL_NAME}..." From 55db7c3d2feea23e97c67ff05cb4dd45888d77d6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Feb 2026 06:59:03 +0000 Subject: [PATCH 4/5] Use curl --retry 3 --retry-delay 5 instead of custom helper function Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/sh/install_awf_binary.sh | 25 +++---------------------- actions/setup/sh/install_copilot_cli.sh | 23 ++--------------------- 2 files changed, 5 insertions(+), 43 deletions(-) diff --git a/actions/setup/sh/install_awf_binary.sh b/actions/setup/sh/install_awf_binary.sh index 4cf6390ade..4fbb46bb89 100755 --- a/actions/setup/sh/install_awf_binary.sh +++ b/actions/setup/sh/install_awf_binary.sh @@ -59,28 +59,9 @@ sha256_hash() { TEMP_DIR=$(mktemp -d) trap 'rm -rf "$TEMP_DIR"' EXIT -# Download a URL to a file with exponential backoff retry (3 attempts: 0s, 5s, 10s) -curl_with_retry() { - local url="$1" - local output="$2" - local delay=5 - for attempt in 1 2 3; do - if curl -fsSL -o "$output" "$url"; then - return 0 - fi - if [ "$attempt" -lt 3 ]; then - echo "Download attempt $attempt failed, retrying in ${delay}s..." - sleep "$delay" - delay=$((delay * 2)) - fi - done - echo "ERROR: Failed to download ${url} after 3 attempts" - return 1 -} - # Download checksums echo "Downloading checksums from ${CHECKSUMS_URL@Q}..." -curl_with_retry "${CHECKSUMS_URL}" "${TEMP_DIR}/checksums.txt" +curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}" verify_checksum() { local file="$1" @@ -118,7 +99,7 @@ install_linux_binary() { local binary_url="${BASE_URL}/${awf_binary}" echo "Downloading binary from ${binary_url@Q}..." - curl_with_retry "${binary_url}" "${TEMP_DIR}/${awf_binary}" + curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/${awf_binary}" "${binary_url}" # Verify checksum verify_checksum "${TEMP_DIR}/${awf_binary}" "${awf_binary}" @@ -143,7 +124,7 @@ install_darwin_binary() { local binary_url="${BASE_URL}/${awf_binary}" echo "Downloading binary from ${binary_url@Q}..." - curl_with_retry "${binary_url}" "${TEMP_DIR}/${awf_binary}" + curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/${awf_binary}" "${binary_url}" # Verify checksum verify_checksum "${TEMP_DIR}/${awf_binary}" "${awf_binary}" diff --git a/actions/setup/sh/install_copilot_cli.sh b/actions/setup/sh/install_copilot_cli.sh index 5862ba1a96..050bf4f989 100755 --- a/actions/setup/sh/install_copilot_cli.sh +++ b/actions/setup/sh/install_copilot_cli.sh @@ -81,36 +81,17 @@ sha256_hash() { fi } -# Download a URL to a file with exponential backoff retry (3 attempts: 0s, 5s, 10s) -curl_with_retry() { - local url="$1" - local output="$2" - local delay=5 - for attempt in 1 2 3; do - if curl -fsSL -o "$output" "$url"; then - return 0 - fi - if [ "$attempt" -lt 3 ]; then - echo "Download attempt $attempt failed, retrying in ${delay}s..." - sleep "$delay" - delay=$((delay * 2)) - fi - done - echo "ERROR: Failed to download ${url} after 3 attempts" - return 1 -} - # Create temp directory with cleanup on exit TEMP_DIR=$(mktemp -d) trap 'rm -rf "$TEMP_DIR"' EXIT # Download checksums echo "Downloading checksums from ${CHECKSUMS_URL}..." -curl_with_retry "${CHECKSUMS_URL}" "${TEMP_DIR}/SHA256SUMS.txt" +curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}" # Download binary tarball echo "Downloading binary from ${TARBALL_URL}..." -curl_with_retry "${TARBALL_URL}" "${TEMP_DIR}/${TARBALL_NAME}" +curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/${TARBALL_NAME}" "${TARBALL_URL}" # Verify checksum echo "Verifying SHA256 checksum for ${TARBALL_NAME}..." From e3d1f0cd174694ba2805c8937ef59f21afc8a290 Mon Sep 17 00:00:00 2001 From: Runner Bot Date: Mon, 23 Feb 2026 07:07:06 +0000 Subject: [PATCH 5/5] Add changeset [skip-ci] --- .changeset/patch-retry-downloads.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .changeset/patch-retry-downloads.md diff --git a/.changeset/patch-retry-downloads.md b/.changeset/patch-retry-downloads.md new file mode 100644 index 0000000000..42e7652587 --- /dev/null +++ b/.changeset/patch-retry-downloads.md @@ -0,0 +1,4 @@ +--- +"gh-aw": patch +--- +Add curl --retry 3 --retry-delay 5 to installer downloads so transient 502s no longer fail workflows.