From f55787e947da3a43a3fabc06559c07ab03dd46ab Mon Sep 17 00:00:00 2001 From: uefibot Date: Thu, 27 Jun 2024 09:04:35 +0000 Subject: [PATCH] Repo File Sync: synced file(s) with microsoft/mu_devops Signed-off-by: Project Mu UEFI Bot --- .github/workflows/codeql.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 3ccb421..d7bbbeb 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -161,11 +161,21 @@ jobs: import os import requests import sys + import time + + def get_response_with_retries(url, retries=5, wait_time=10): + for attempt in range(retries): + response = requests.get(url) + if response.status_code == 200: + return response + print(f"::warning title=GitHub API Access Error!::Attempt {attempt + 1} failed. Retrying in {wait_time} seconds...") + time.sleep(wait_time) + return response GITHUB_REPO = "sagiegurari/cargo-make" api_url = f"https://api.github.com/repos/{GITHUB_REPO}/releases/tags/0.37.9" - response = requests.get(api_url) + response = get_response_with_retries(api_url) if response.status_code == 200: build_release_id = response.json()["id"] else: @@ -174,7 +184,7 @@ jobs: api_url = f"https://api.github.com/repos/{GITHUB_REPO}/releases/{build_release_id}" - response = requests.get(api_url) + response = get_response_with_retries(api_url) if response.status_code == 200: latest_cargo_make_version = response.json()["tag_name"] else: