Skip to content

Commit

Permalink
fix: api endpoint if ghe is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardojdsilva87 committed Oct 28, 2024
1 parent 0a41710 commit 9dc1ec3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def get_github_app_installation_token(
str: the GitHub App token
"""
jwt_headers = github3.apps.create_jwt_headers(gh_app_private_key_bytes, gh_app_id)
api_endpoint = f"{ghe}/api/v3" if ghe else "api.github.com"
api_endpoint = f"{ghe}/api/v3" if ghe else "https://api.github.com"
url = f"{api_endpoint}/app/installations/{gh_app_installation_id}/access_tokens"

try:
Expand Down
4 changes: 2 additions & 2 deletions contributor_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ def get_sponsor_information(contributors: list, token: str, ghe: str) -> list:
variables = {"username": contributor.username}

# Send the GraphQL request
api_endpoint = f"{ghe}/api/v3" if ghe else "api.github.com"
api_endpoint = f"{ghe}/api/v3" if ghe else "https://api.github.com"
headers = {"Authorization": f"Bearer {token}"}
response = requests.post(
f"https://{api_endpoint}/graphql",
f"{api_endpoint}/graphql",
json={"query": query, "variables": variables},
headers=headers,
timeout=60,
Expand Down

0 comments on commit 9dc1ec3

Please sign in to comment.