diff --git a/graphql_query.py b/graphql_query.py index 65610ce..c53f10e 100644 --- a/graphql_query.py +++ b/graphql_query.py @@ -9,7 +9,7 @@ # in a later version we can replace the 2015 date with user input while current_year >= 2015: - TEMP_QUERY = f""" + temp_query = f""" {"_" + str(current_year)}: contributionsCollection(from: "{str(current_year)}-01-01T00:00:00") {{ contributionCalendar {{ totalContributions @@ -17,10 +17,10 @@ }} """ - contribution_list.append(TEMP_QUERY) + contribution_list.append(temp_query) current_year -= 1 -QUERY = f""" +REQUEST_QUERY = f""" {{ user(login: "{getenv("INPUT_GITHUB_USERNAME")}") {{ {linesep.join(contribution_list)} diff --git a/readme_level.py b/readme_level.py index 48a9a06..81f82da 100644 --- a/readme_level.py +++ b/readme_level.py @@ -3,7 +3,7 @@ from datetime import datetime from logging import exception, info from requests import post -from graphql_query import QUERY +from graphql_query import REQUEST_QUERY from readme_data import ReadmeLevelData @@ -28,7 +28,7 @@ def fetch_user_data(self) -> dict[str, int] | None: auth_header = {"Authorization": "Bearer " + getenv("INPUT_GITHUB_TOKEN")} response = post("https://api.github.com/graphql", - json={"query": QUERY}, headers=auth_header, timeout=2) + json={"query": REQUEST_QUERY}, headers=auth_header, timeout=2) if response.status_code == 200: info("request to github api was successfull")