From 2e2497e3026f27c63f24f23f5de5cf397fa0e24a Mon Sep 17 00:00:00 2001 From: pseusys Date: Sun, 26 Feb 2023 09:30:49 +0100 Subject: [PATCH] pr_number is an integer --- sources/manager_download.py | 5 ++--- sources/manager_environment.py | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sources/manager_download.py b/sources/manager_download.py index 5c514a2..62c2ed4 100644 --- a/sources/manager_download.py +++ b/sources/manager_download.py @@ -227,15 +227,14 @@ class DownloadManager: return await DownloadManager._get_remote_resource(resource, safe_load) @staticmethod - async def _fetch_graphql_query(query: str, use_github_action: bool = False, **kwargs) -> Dict: + async def _fetch_graphql_query(query: str, **kwargs) -> Dict: """ Execute GitHub GraphQL API simple query. :param query: Dynamic query identifier. - :param use_github_action: Whether to perform query using CURRENT_GITHUB_ACTION_TOKEN. :param kwargs: Parameters for substitution of variables in dynamic query. :return: Response JSON dictionary. """ - headers = {"Authorization": f"Bearer {EM.GH_TOKEN if not use_github_action else EM.CURRENT_GITHUB_ACTION_TOKEN}"} + headers = {"Authorization": f"Bearer {EM.GH_TOKEN}"} res = await DownloadManager._client.post( "https://api.github.com/graphql", json={"query": Template(GITHUB_API_QUERIES[query]).substitute(kwargs)}, headers=headers ) diff --git a/sources/manager_environment.py b/sources/manager_environment.py index ee1da4d..53c543c 100644 --- a/sources/manager_environment.py +++ b/sources/manager_environment.py @@ -46,5 +46,4 @@ class EnvironmentManager: DEBUG_LOGGING = getenv("INPUT_DEBUG_LOGGING", "0").lower() in _TRUTHY DEBUG_RUN = getenv("DEBUG_RUN", "False").lower() in _TRUTHY - PR_NUMBER = getenv("PR_NUMBER", "") - CURRENT_GITHUB_ACTION_TOKEN = getenv("CURRENT_GITHUB_ACTION_TOKEN", "") + PR_NUMBER = int(getenv("PR_NUMBER", "0"))