mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 12:50:38 +08:00
Update get_repo_settings in bitbucket_provider.py to fetch file via API request
This commit is contained in:
@ -41,9 +41,10 @@ class BitbucketProvider(GitProvider):
|
|||||||
|
|
||||||
def get_repo_settings(self):
|
def get_repo_settings(self):
|
||||||
try:
|
try:
|
||||||
contents = self.repo_obj.get_contents(
|
url = (f"https://api.bitbucket.org/2.0/repositories/{self.workspace_slug}/{self.repo_slug}/src/"
|
||||||
".pr_agent.toml", ref=self.pr.head.sha
|
f"{self.pr.destination_branch}/.pr_agent.toml")
|
||||||
).decoded_content
|
response = requests.request("GET", url, headers=self.headers)
|
||||||
|
contents = response.text.encode('utf-8')
|
||||||
return contents
|
return contents
|
||||||
except Exception:
|
except Exception:
|
||||||
return ""
|
return ""
|
||||||
|
Reference in New Issue
Block a user