From b5aefd39f5cab76003144f8b3e0e4304ea330a64 Mon Sep 17 00:00:00 2001 From: "Project Mu UEFI Bot [bot]" <45776386+uefibot@users.noreply.github.com> Date: Thu, 27 Jun 2024 11:16:36 -0400 Subject: [PATCH] Repo File Sync: synced file(s) with microsoft/mu_devops (#507) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit synced local file(s) with [microsoft/mu_devops](https://github.com/microsoft/mu_devops). 🤖: View the [Repo File Sync Configuration File](https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml) to see how files are synced. --- This PR was created automatically by the [repo-file-sync-action](https://github.com/BetaHuhn/repo-file-sync-action) workflow run [#9693751051](https://github.com/microsoft/mu_devops/actions/runs/9693751051) 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 3ccb42177c..d7bbbebc5b 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: