Skip to content

Commit 7d091d8

Browse files
authored
add option to retry all errors (#18)
Signed-off-by: Kenny Leung <kleung@chainguard.dev>
1 parent 8d93dcb commit 7d091d8

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

action.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,21 @@ inputs:
5858
required: false
5959
default: ''
6060

61+
retry-all-errors:
62+
description: |
63+
Whether to retry on all errors.
64+
required: false
65+
default: false
66+
67+
6168
runs:
6269
using: "composite"
6370

6471
steps:
6572
- name: Install chainctl
6673
shell: bash
74+
env:
75+
CURL_RETRY_ALL_ERRORS: ${{ inputs.retry-all-errors }}
6776
run: |
6877
cd $(mktemp -d)
6978
@@ -89,7 +98,11 @@ runs:
8998
fi
9099
echo "Downloading chainctl from ${url}"
91100
92-
curl -o ./${out} -fsL --retry 5 --retry-delay 1 "${url}"
101+
if [[ "${{ env.CURL_RETRY_ALL_ERRORS }}" != "true" ]]; then
102+
curl -o ./${out} -fsL --retry 5 --retry-delay 1 "${url}"
103+
else
104+
curl -o ./${out} -fsL --retry 5 --retry-delay 1 --retry-all-errors "${url}"
105+
fi
93106
chmod +x ./${out}
94107
echo "$(pwd)" >> $GITHUB_PATH
95108

0 commit comments

Comments
 (0)