Skip to content

Commit

Permalink
Update get_repo_settings in bitbucket_provider.py to fetch file via A…
Browse files Browse the repository at this point in the history
…PI request
  • Loading branch information
okotek committed Oct 30, 2023
1 parent 4bda9df commit 73bb70f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pr_agent/git_providers/bitbucket_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ def __init__(

def get_repo_settings(self):
try:
contents = self.repo_obj.get_contents(
".pr_agent.toml", ref=self.pr.head.sha
).decoded_content
url = (f"https://api.bitbucket.org/2.0/repositories/{self.workspace_slug}/{self.repo_slug}/src/"
f"{self.pr.destination_branch}/.pr_agent.toml")
response = requests.request("GET", url, headers=self.headers)
contents = response.text.encode('utf-8')
return contents
except Exception:
return ""
Expand Down

0 comments on commit 73bb70f

Please sign in to comment.