From eaf2b82eda199260022504a1a0f7966b0dd56944 Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Wed, 31 Jul 2024 18:44:04 -0400 Subject: .github/request-reviews.yml: Removed unused functionality Removed the `download_gh_file()` function which is no longer needed with sparse checkout. Signed-off-by: Michael Kubacki --- .github/scripts/GitHub.py | 27 --------------------------- .github/scripts/requirements.txt | 1 - 2 files changed, 28 deletions(-) diff --git a/.github/scripts/GitHub.py b/.github/scripts/GitHub.py index da9e94a84d..43eb5c7e4f 100644 --- a/.github/scripts/GitHub.py +++ b/.github/scripts/GitHub.py @@ -8,7 +8,6 @@ import git import logging import re -import requests from collections import OrderedDict from edk2toollib.utility_functions import RunPythonScript @@ -173,32 +172,6 @@ def get_pr_sha(token: str, owner: str, repo: str, pr_number: int) -> str: return "" -def download_gh_file(github_url: str, local_path: str, token=None): - """Downloads a file from GitHub. - - Args: - github_url (str): The GitHub raw file URL. - local_path (str): A local path to write the file contents to. - token (_type_, optional): A GitHub authentication token. - Only needed for a private repo. Defaults to None. - """ - headers = {} - if token: - headers["Authorization"] = f"Bearer {token}" - - try: - response = requests.get(github_url, headers=headers) - response.raise_for_status() - except requests.exceptions.HTTPError: - print( - f"::error title=HTTP Error!::Error downloading {github_url}: {response.reason}" - ) - return - - with open(local_path, "w", encoding="utf-8") as file: - file.write(response.text) - - def add_reviewers_to_pr( token: str, owner: str, repo: str, pr_number: int, user_names: List[str] ) -> List[str]: diff --git a/.github/scripts/requirements.txt b/.github/scripts/requirements.txt index 44f0bdd335..c589084ab0 100644 --- a/.github/scripts/requirements.txt +++ b/.github/scripts/requirements.txt @@ -11,4 +11,3 @@ edk2-pytool-library==0.* GitPython==3.* PyGithub==2.* -requests==2.* -- cgit