mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 16:14:04 +02:00
.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 <michael.kubacki@microsoft.com>
This commit is contained in:
parent
d3e9e10770
commit
eaf2b82eda
27
.github/scripts/GitHub.py
vendored
27
.github/scripts/GitHub.py
vendored
@ -8,7 +8,6 @@
|
|||||||
import git
|
import git
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
import requests
|
|
||||||
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from edk2toollib.utility_functions import RunPythonScript
|
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 ""
|
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(
|
def add_reviewers_to_pr(
|
||||||
token: str, owner: str, repo: str, pr_number: int, user_names: List[str]
|
token: str, owner: str, repo: str, pr_number: int, user_names: List[str]
|
||||||
) -> List[str]:
|
) -> List[str]:
|
||||||
|
1
.github/scripts/requirements.txt
vendored
1
.github/scripts/requirements.txt
vendored
@ -11,4 +11,3 @@
|
|||||||
edk2-pytool-library==0.*
|
edk2-pytool-library==0.*
|
||||||
GitPython==3.*
|
GitPython==3.*
|
||||||
PyGithub==2.*
|
PyGithub==2.*
|
||||||
requests==2.*
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user