Skip to content

Commit

Permalink
Merge pull request #91 from ShaneMalachow/main
Browse files Browse the repository at this point in the history
Authenticate to GitHub Enterprise Server instances
  • Loading branch information
zkoppert authored Aug 2, 2023
2 parents 8a52b69 + c567611 commit 6eea04d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion issue_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ def auth_to_github() -> github3.GitHub:
github3.GitHub: A github api connection.
"""
if token := os.getenv("GH_TOKEN"):
github_connection = github3.login(token=token)
if not os.getenv("GITHUB_SERVER_URL"):
github_connection = github3.login(token=token)
elif os.getenv("GITHUB_SERVER_URL") == 'https://github.com':
github_connection = github3.login(token=token)
else:
github_connection = github3.GitHubEnterprise(os.getenv("GITHUB_SERVER_URL"),token=token)
else:
raise ValueError("GH_TOKEN environment variable not set")

Expand Down

0 comments on commit 6eea04d

Please sign in to comment.