File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -153,30 +153,30 @@ jobs:
153
153
run : |
154
154
BOARD_NAME="${{fromJson(steps.get_board_json.outputs.boardJson).bootloaderBoardName}}"
155
155
set +e
156
- for attempt in 1 2; do
156
+ for attempt in 1 2 3 ; do
157
157
echo "Attempt $attempt: Fetching tinyuf2 release info for board $BOARD_NAME"
158
158
API_RESPONSE=$(curl --silent --fail https://api.github.com/repos/adafruit/tinyuf2/releases/latest)
159
159
if [ $? -ne 0 ]; then
160
160
echo "Attempt $attempt: curl failed to fetch release info."
161
- if [ "$attempt" -eq 2 ]; then exit 1; else sleep 2 ; continue; fi
161
+ if [ "$attempt" -eq 3 ]; then exit 1; else sleep $((60 + RANDOM % 40)) ; continue; fi
162
162
fi
163
163
DOWNLOAD_URL=$(echo "$API_RESPONSE" | jq -r '.assets[] | select(.browser_download_url | contains("tinyuf2-'$BOARD_NAME'-") and endswith(".zip")) | .browser_download_url // empty'); JQ_EXIT=$?
164
164
if [ $JQ_EXIT -ne 0 ] || [ -z "$DOWNLOAD_URL" ]; then
165
165
echo "Attempt $attempt: jq failed or no matching zip found."
166
- if [ "$attempt" -eq 2 ]; then exit 1; else sleep 2 ; continue; fi
166
+ if [ "$attempt" -eq 3 ]; then exit 1; else sleep $((60 + RANDOM % 40)) ; continue; fi
167
167
fi
168
168
echo "Attempt $attempt: Downloading $DOWNLOAD_URL"
169
169
wget "$DOWNLOAD_URL" -O tinyuf2.zip
170
170
if [ $? -eq 0 ]; then
171
171
unzip -o tinyuf2.zip -d .
172
172
if [ $? -ne 0 ]; then
173
173
echo "Attempt $attempt: unzip failed"
174
- if [ "$attempt" -eq 2 ]; then exit 1; else sleep 2 ; continue; fi
174
+ if [ "$attempt" -eq 3 ]; then exit 1; else sleep $((60 + RANDOM % 40)) ; continue; fi
175
175
fi
176
176
break
177
177
else
178
178
echo "Attempt $attempt: wget failed to download $DOWNLOAD_URL"
179
- if [ "$attempt" -eq 2 ]; then exit 1; else sleep 2 ; fi
179
+ if [ "$attempt" -eq 3 ]; then exit 1; else sleep $((60 + RANDOM % 40)) ; fi
180
180
fi
181
181
done
182
182
set -e
You can’t perform that action at this time.
0 commit comments