Skip to content

Conversation

gpflaum
Copy link

@gpflaum gpflaum commented Jan 31, 2021

No description provided.

Pass base_url parameter to PyGithub when using GitHub Enterprise.
Comment on lines +37 to +40
kwargs = {"login_or_token": self._auth.token}
if self.meta.get("base_url"):
kwargs["base_url"] = self.meta.get("base_url")
self.gh = Github(**kwargs)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, could do it like this:

Suggested change
kwargs = {"login_or_token": self._auth.token}
if self.meta.get("base_url"):
kwargs["base_url"] = self.meta.get("base_url")
self.gh = Github(**kwargs)
if self.meta.get("base_url"):
self.gh = Github(login_or_token=self._auth.token, base_url=self.meta.get("base_url")
else:
self.gh = Github(login_or_token=self._auth.token)

And similarly for the call above to GithubIntegration().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant