Skip to content

Retry downloads in case of failure - #16

Closed
sionescu wants to merge 2 commits into
imjasonh:mainfrom
sionescu:fetch-retry
Closed

Retry downloads in case of failure#16
sionescu wants to merge 2 commits into
imjasonh:mainfrom
sionescu:fetch-retry

Conversation

@sionescu

@sionescu sionescu commented Nov 20, 2025

Copy link
Copy Markdown

Curl will now retry the download up to 10 times or 2 minutes.

Curl will now retry the download up to 10 times or 2 minutes.
Comment thread action.yml Outdated
@imjasonh
imjasonh requested a review from Copilot November 22, 2025 01:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the reliability of the crane installation process by adding retry logic to the download step. The changes prevent transient network failures from breaking the setup action by allowing curl to retry up to 10 times within a 2-minute window.

Key Changes

  • Extracted the download URL to a separate variable for clarity
  • Added retry flags (--retry 10, --retry-max-time 120) and --remove-on-error to the curl command
  • Modified the download to save to an intermediate file (out.tar.gz) instead of piping directly to tar

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread action.yml
curl -fsL \
--remove-on-error --retry 10 --retry-max-time 120 \
-o out.tar.gz ${url} || exit 1
tar xz -f out.tar.gz ${out}

Copilot AI Nov 22, 2025

Copy link

Choose a reason for hiding this comment

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

The tar command syntax is incorrect. The correct syntax for GNU tar is tar xzf out.tar.gz ${out} (no space between flags and argument) or tar -xzf out.tar.gz ${out} (with hyphens). The current syntax tar xz -f out.tar.gz ${out} will not work correctly because xz is treated as separate options and then -f is a separate option.

Suggested change
tar xz -f out.tar.gz ${out}
tar xzf out.tar.gz ${out}

Copilot uses AI. Check for mistakes.
Comment thread action.yml
Comment on lines +55 to +56
--remove-on-error --retry 10 --retry-max-time 120 \
-o out.tar.gz ${url} || exit 1

Copilot AI Nov 22, 2025

Copy link

Choose a reason for hiding this comment

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

The --remove-on-error flag is not available in older versions of curl (it was added in curl 7.83.0, released in April 2022). Consider verifying that the GitHub Actions runners have a compatible curl version, or provide a fallback mechanism. Alternatively, you could manually remove the file on error: curl -fsL --retry 10 --retry-max-time 120 -o out.tar.gz ${url} || { rm -f out.tar.gz; exit 1; }

Suggested change
--remove-on-error --retry 10 --retry-max-time 120 \
-o out.tar.gz ${url} || exit 1
--retry 10 --retry-max-time 120 \
-o out.tar.gz ${url} || { rm -f out.tar.gz; exit 1; }

Copilot uses AI. Check for mistakes.
@imjasonh

imjasonh commented Jun 1, 2026

Copy link
Copy Markdown
Owner

superceded by #17

@imjasonh imjasonh closed this Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants