Skip to content

Commit e52f1db

Browse files
authored
Merge pull request #863 from adafruit/fix-curl-tinyuf2-release-timeouts
fix(ci): Replace curl with gh command to fetch release info
2 parents 9c44317 + 5b0194b commit e52f1db

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/build-clang-doxy.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,19 @@ jobs:
154154
echo EOF
155155
} >> "$GITHUB_OUTPUT"
156156
- name: fetch tinyuf2 combined.bin
157+
env:
158+
GH_TOKEN: ${{ github.token }}
157159
run: |
158160
BOARD_NAME="${{fromJson(steps.get_board_json.outputs.boardJson).bootloaderBoardName}}"
159161
set +e
160162
for attempt in 1 2 3; do
161163
echo "Attempt $attempt: Fetching tinyuf2 release info for board $BOARD_NAME"
162-
API_RESPONSE=$(curl --silent --fail https://api.github.com/repos/adafruit/tinyuf2/releases/latest)
164+
API_RESPONSE=$(gh release view --repo adafruit/tinyuf2 --json assets)
163165
if [ $? -ne 0 ]; then
164166
echo "Attempt $attempt: curl failed to fetch release info."
165167
if [ "$attempt" -eq 3 ]; then exit 1; else sleep $((60 + RANDOM % 40)); continue; fi
166168
fi
167-
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=$?
169+
DOWNLOAD_URL=$(echo "$API_RESPONSE" | jq -r '.assets[] | select(.url | contains("tinyuf2-'$BOARD_NAME'-") and endswith(".zip")) | .url // empty'); JQ_EXIT=$?
168170
if [ $JQ_EXIT -ne 0 ] || [ -z "$DOWNLOAD_URL" ]; then
169171
echo "Attempt $attempt: jq failed or no matching zip found."
170172
if [ "$attempt" -eq 3 ]; then exit 1; else sleep $((60 + RANDOM % 40)); continue; fi

0 commit comments

Comments
 (0)