You've already forked wakapi-readme-stats
pr_number is an integer
This commit is contained in:
@@ -227,15 +227,14 @@ class DownloadManager:
|
|||||||
return await DownloadManager._get_remote_resource(resource, safe_load)
|
return await DownloadManager._get_remote_resource(resource, safe_load)
|
||||||
|
|
||||||
@staticmethod
|
@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.
|
Execute GitHub GraphQL API simple query.
|
||||||
:param query: Dynamic query identifier.
|
: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.
|
:param kwargs: Parameters for substitution of variables in dynamic query.
|
||||||
:return: Response JSON dictionary.
|
: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(
|
res = await DownloadManager._client.post(
|
||||||
"https://api.github.com/graphql", json={"query": Template(GITHUB_API_QUERIES[query]).substitute(kwargs)}, headers=headers
|
"https://api.github.com/graphql", json={"query": Template(GITHUB_API_QUERIES[query]).substitute(kwargs)}, headers=headers
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -46,5 +46,4 @@ class EnvironmentManager:
|
|||||||
|
|
||||||
DEBUG_LOGGING = getenv("INPUT_DEBUG_LOGGING", "0").lower() in _TRUTHY
|
DEBUG_LOGGING = getenv("INPUT_DEBUG_LOGGING", "0").lower() in _TRUTHY
|
||||||
DEBUG_RUN = getenv("DEBUG_RUN", "False").lower() in _TRUTHY
|
DEBUG_RUN = getenv("DEBUG_RUN", "False").lower() in _TRUTHY
|
||||||
PR_NUMBER = getenv("PR_NUMBER", "")
|
PR_NUMBER = int(getenv("PR_NUMBER", "0"))
|
||||||
CURRENT_GITHUB_ACTION_TOKEN = getenv("CURRENT_GITHUB_ACTION_TOKEN", "")
|
|
||||||
|
|||||||
Reference in New Issue
Block a user