Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changeset/patch-retry-downloads.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions actions/setup/sh/install_awf_binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 --retry-delay 5 -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}"
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --retry flag by default only retries on transient network errors (connection failures, timeouts) but does NOT retry on HTTP error codes like 502 Bad Gateway. To retry on HTTP errors, you need to add the --retry-all-errors flag. The curl command should be:

curl -fsSL --retry 3 --retry-delay 5 --retry-all-errors -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}"

Note: --retry-all-errors was added in curl 7.71.0 (June 2020). If backward compatibility with older curl versions is a concern, you may need to check the curl version first or implement manual retry logic instead.

This issue also appears in the following locations of the same file:

  • line 102
  • line 127
Suggested change
curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}"
curl -fsSL --retry 3 --retry-delay 5 --retry-all-errors -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}"

Copilot uses AI. Check for mistakes.

verify_checksum() {
local file="$1"
Expand Down Expand Up @@ -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 --retry-delay 5 -o "${TEMP_DIR}/${awf_binary}" "${binary_url}"

# Verify checksum
verify_checksum "${TEMP_DIR}/${awf_binary}" "${awf_binary}"
Expand All @@ -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 --retry-delay 5 -o "${TEMP_DIR}/${awf_binary}" "${binary_url}"

# Verify checksum
verify_checksum "${TEMP_DIR}/${awf_binary}" "${awf_binary}"
Expand Down
4 changes: 2 additions & 2 deletions actions/setup/sh/install_copilot_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 --retry-delay 5 -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --retry-delay 5 adds up to ~15s extra time on a fully failing download. This is a reasonable tradeoff for reliability. The flags are consistent across both scripts. ✅

Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --retry flag by default only retries on transient network errors (connection failures, timeouts) but does NOT retry on HTTP error codes like 502 Bad Gateway. To retry on HTTP errors, you need to add the --retry-all-errors flag. The curl command should be:

curl -fsSL --retry 3 --retry-delay 5 --retry-all-errors -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}"

Note: --retry-all-errors was added in curl 7.71.0 (June 2020). If backward compatibility with older curl versions is a concern, you may need to check the curl version first or implement manual retry logic instead.

This issue also appears on line 94 of the same file.

See below for a potential fix:

curl -fsSL --retry 3 --retry-delay 5 --retry-all-errors -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}"

# Download binary tarball
echo "Downloading binary from ${TARBALL_URL}..."
curl -fsSL --retry 3 --retry-delay 5 --retry-all-errors -o "${TEMP_DIR}/${TARBALL_NAME}" "${TARBALL_URL}"

Copilot uses AI. Check for mistakes.

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

# Verify checksum
echo "Verifying SHA256 checksum for ${TARBALL_NAME}..."
Expand Down