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:
153153 run : |
154154 BOARD_NAME="${{fromJson(steps.get_board_json.outputs.boardJson).bootloaderBoardName}}"
155155 set +e
156- for attempt in 1 2; do
156+ for attempt in 1 2 3 ; do
157157 echo "Attempt $attempt: Fetching tinyuf2 release info for board $BOARD_NAME"
158158 API_RESPONSE=$(curl --silent --fail https://api.github.com/repos/adafruit/tinyuf2/releases/latest)
159159 if [ $? -ne 0 ]; then
160160 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
162162 fi
163163 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=$?
164164 if [ $JQ_EXIT -ne 0 ] || [ -z "$DOWNLOAD_URL" ]; then
165165 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
167167 fi
168168 echo "Attempt $attempt: Downloading $DOWNLOAD_URL"
169169 wget "$DOWNLOAD_URL" -O tinyuf2.zip
170170 if [ $? -eq 0 ]; then
171171 unzip -o tinyuf2.zip -d .
172172 if [ $? -ne 0 ]; then
173173 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
175175 fi
176176 break
177177 else
178178 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
180180 fi
181181 done
182182 set -e
You can’t perform that action at this time.
0 commit comments