mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-05 21:30:40 +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")
|
raise ValueError("GitHub app installation ID is required when using GitHub app deployment")
|
||||||
auth = AppAuthentication(app_id=app_id, private_key=private_key,
|
auth = AppAuthentication(app_id=app_id, private_key=private_key,
|
||||||
installation_id=self.installation_id)
|
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':
|
if deployment_type == 'user':
|
||||||
try:
|
try:
|
||||||
@ -414,7 +414,7 @@ class GithubProvider(GitProvider):
|
|||||||
raise ValueError(
|
raise ValueError(
|
||||||
"GitHub token is required when using user deployment. See: "
|
"GitHub token is required when using user deployment. See: "
|
||||||
"https://github.com/Codium-ai/pr-agent#method-2-run-from-source") from e
|
"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):
|
def _get_repo(self):
|
||||||
if hasattr(self, 'repo_obj') and \
|
if hasattr(self, 'repo_obj') and \
|
||||||
|
@ -79,6 +79,7 @@ extra_instructions = ""
|
|||||||
# The type of deployment to create. Valid values are 'app' or 'user'.
|
# The type of deployment to create. Valid values are 'app' or 'user'.
|
||||||
deployment_type = "user"
|
deployment_type = "user"
|
||||||
ratelimit_retries = 5
|
ratelimit_retries = 5
|
||||||
|
base_url = "https://api.github.com"
|
||||||
|
|
||||||
[github_action]
|
[github_action]
|
||||||
# auto_review = true # set as env var in .github/workflows/pr-agent.yaml
|
# auto_review = true # set as env var in .github/workflows/pr-agent.yaml
|
||||||
|
Reference in New Issue
Block a user