Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions graphql_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
# 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
}}
}}
"""

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)}
Expand Down
4 changes: 2 additions & 2 deletions readme_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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")
Expand Down
Loading