mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-12 19:05:18 +00:00
Support repo-specific configuration file
This commit is contained in:
parent
450f410e3c
commit
696e2bd6ff
2 changed files with 3 additions and 3 deletions
|
|
@ -266,7 +266,7 @@ class GithubProvider(GitProvider):
|
|||
|
||||
def get_repo_settings(self):
|
||||
try:
|
||||
contents = self.repo_obj.get_contents(".pr_agent.yaml", ref=self.pr.head.sha).decoded_content
|
||||
contents = self.repo_obj.get_contents(".pr_agent.toml", ref=self.pr.head.sha).decoded_content
|
||||
return contents
|
||||
except Exception:
|
||||
return ""
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class GitLabProvider(GitProvider):
|
|||
if repo_settings:
|
||||
repo_settings_file = None
|
||||
try:
|
||||
fd, repo_settings_file = tempfile.mkstemp(suffix='.yaml')
|
||||
fd, repo_settings_file = tempfile.mkstemp(suffix='.toml')
|
||||
os.write(fd, repo_settings.encode())
|
||||
get_settings().load_file(repo_settings_file)
|
||||
finally:
|
||||
|
|
@ -268,7 +268,7 @@ class GitLabProvider(GitProvider):
|
|||
|
||||
def get_repo_settings(self):
|
||||
try:
|
||||
contents = self.gl.projects.get(self.id_project).files.get(file_path='.pr_agent.yaml', ref=self.mr.source_branch).decode()
|
||||
contents = self.gl.projects.get(self.id_project).files.get(file_path='.pr_agent.toml', ref=self.mr.source_branch).decode()
|
||||
return contents
|
||||
except Exception:
|
||||
return ""
|
||||
|
|
|
|||
Loading…
Reference in a new issue