Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo File Sync: synced file(s) with microsoft/mu_devops #241

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
Loading