File tree Expand file tree Collapse file tree 1 file changed +31
-3
lines changed
Expand file tree Collapse file tree 1 file changed +31
-3
lines changed Original file line number Diff line number Diff line change 6060 info " Downloading and verifying actionlint verion $EXPECTED_VERSION ..." >&2
6161
6262 readonly TARBALL=" $SCRIPT_DIR /actionlint.tar.gz"
63- if ! curl -sL " https://github.com/rhysd/actionlint/releases/download/v${EXPECTED_VERSION} /${TARBALL_NAME} " -o " $TARBALL " ; then
64- error " Unable to download actionlint binary"
65- exit 1
63+
64+ # --fail: Makes curl return error on HTTP errors (4xx, 5xx)
65+ # --location: Follow redirects
66+ # --retry: Retry on transient errors
67+ # --retry-delay: Wait between retry attempts
68+ curl --fail --location \
69+ --retry 3 \
70+ --retry-delay 3 \
71+ " https://github.com/rhysd/actionlint/releases/download/v${EXPECTED_VERSION} /${TARBALL_NAME} " \
72+ --output " $TARBALL "
73+ CURL_EXIT=$?
74+
75+ if [[ $CURL_EXIT -ne 0 ]]; then
76+ case $CURL_EXIT in
77+ 18)
78+ error " Download failed: partial file transfer (network interrupted)" >&2
79+ ;;
80+ 22)
81+ error " Download failed: HTTP error from GitHub" >&2
82+ ;;
83+ 28)
84+ error " Download failed: operation timeout" >&2
85+ ;;
86+ 56)
87+ error " Download failed: network connection issue" >&2
88+ ;;
89+ * )
90+ error " Download failed with curl exit code $CURL_EXIT " >&2
91+ ;;
92+ esac
93+ exit " $CURL_EXIT "
6694 fi
6795
6896 # Ensure tarball is cleaned up
You can’t perform that action at this time.
0 commit comments