Skip to content

Commit 9dc1ec3

Browse files
fix: api endpoint if ghe is not set
1 parent 0a41710 commit 9dc1ec3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def get_github_app_installation_token(
6969
str: the GitHub App token
7070
"""
7171
jwt_headers = github3.apps.create_jwt_headers(gh_app_private_key_bytes, gh_app_id)
72-
api_endpoint = f"{ghe}/api/v3" if ghe else "api.github.com"
72+
api_endpoint = f"{ghe}/api/v3" if ghe else "https://api.github.com"
7373
url = f"{api_endpoint}/app/installations/{gh_app_installation_id}/access_tokens"
7474

7575
try:

contributor_stats.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ def get_sponsor_information(contributors: list, token: str, ghe: str) -> list:
153153
variables = {"username": contributor.username}
154154

155155
# Send the GraphQL request
156-
api_endpoint = f"{ghe}/api/v3" if ghe else "api.github.com"
156+
api_endpoint = f"{ghe}/api/v3" if ghe else "https://api.github.com"
157157
headers = {"Authorization": f"Bearer {token}"}
158158
response = requests.post(
159-
f"https://{api_endpoint}/graphql",
159+
f"{api_endpoint}/graphql",
160160
json={"query": query, "variables": variables},
161161
headers=headers,
162162
timeout=60,

0 commit comments

Comments
 (0)