mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-02 03:40:38 +08:00
Add support for base_url in GitHub SDK
This commit is contained in:
@ -405,7 +405,7 @@ class GithubProvider(GitProvider):
|
||||
raise ValueError("GitHub app installation ID is required when using GitHub app deployment")
|
||||
auth = AppAuthentication(app_id=app_id, private_key=private_key,
|
||||
installation_id=self.installation_id)
|
||||
return Github(app_auth=auth)
|
||||
return Github(app_auth=auth, base_url=get_settings().github.base_url)
|
||||
|
||||
if deployment_type == 'user':
|
||||
try:
|
||||
@ -414,7 +414,7 @@ class GithubProvider(GitProvider):
|
||||
raise ValueError(
|
||||
"GitHub token is required when using user deployment. See: "
|
||||
"https://github.com/Codium-ai/pr-agent#method-2-run-from-source") from e
|
||||
return Github(auth=Auth.Token(token))
|
||||
return Github(auth=Auth.Token(token), base_url=get_settings().github.base_url)
|
||||
|
||||
def _get_repo(self):
|
||||
if hasattr(self, 'repo_obj') and \
|
||||
|
@ -79,6 +79,7 @@ extra_instructions = ""
|
||||
# The type of deployment to create. Valid values are 'app' or 'user'.
|
||||
deployment_type = "user"
|
||||
ratelimit_retries = 5
|
||||
base_url = "https://api.github.com"
|
||||
|
||||
[github_action]
|
||||
# auto_review = true # set as env var in .github/workflows/pr-agent.yaml
|
||||
|
Reference in New Issue
Block a user