Skip to content

Commit cb678b4

Browse files
authored
Add --retry 3 with delay to curl downloads to handle transient 502s (#17841)
1 parent 2f34639 commit cb678b4

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

.changeset/patch-retry-downloads.md

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

actions/setup/sh/install_awf_binary.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ trap 'rm -rf "$TEMP_DIR"' EXIT
6161

6262
# Download checksums
6363
echo "Downloading checksums from ${CHECKSUMS_URL@Q}..."
64-
curl -fsSL -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}"
64+
curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}"
6565

6666
verify_checksum() {
6767
local file="$1"
@@ -99,7 +99,7 @@ install_linux_binary() {
9999

100100
local binary_url="${BASE_URL}/${awf_binary}"
101101
echo "Downloading binary from ${binary_url@Q}..."
102-
curl -fsSL -o "${TEMP_DIR}/${awf_binary}" "${binary_url}"
102+
curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/${awf_binary}" "${binary_url}"
103103

104104
# Verify checksum
105105
verify_checksum "${TEMP_DIR}/${awf_binary}" "${awf_binary}"
@@ -124,7 +124,7 @@ install_darwin_binary() {
124124

125125
local binary_url="${BASE_URL}/${awf_binary}"
126126
echo "Downloading binary from ${binary_url@Q}..."
127-
curl -fsSL -o "${TEMP_DIR}/${awf_binary}" "${binary_url}"
127+
curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/${awf_binary}" "${binary_url}"
128128

129129
# Verify checksum
130130
verify_checksum "${TEMP_DIR}/${awf_binary}" "${awf_binary}"

actions/setup/sh/install_copilot_cli.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ trap 'rm -rf "$TEMP_DIR"' EXIT
8787

8888
# Download checksums
8989
echo "Downloading checksums from ${CHECKSUMS_URL}..."
90-
curl -fsSL -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}"
90+
curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}"
9191

9292
# Download binary tarball
9393
echo "Downloading binary from ${TARBALL_URL}..."
94-
curl -fsSL -o "${TEMP_DIR}/${TARBALL_NAME}" "${TARBALL_URL}"
94+
curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/${TARBALL_NAME}" "${TARBALL_URL}"
9595

9696
# Verify checksum
9797
echo "Verifying SHA256 checksum for ${TARBALL_NAME}..."

0 commit comments

Comments
 (0)