Skip to content

Commit 02d9aed

Browse files
committed
Fix GitLab provider to use default branch instead of target branch for repo settings
1 parent 7d47bd5 commit 02d9aed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pr_agent/git_providers/gitlab_provider.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,8 @@ def get_issue_comments(self):
515515

516516
def get_repo_settings(self):
517517
try:
518-
contents = self.gl.projects.get(self.id_project).files.get(file_path='.pr_agent.toml', ref=self.mr.target_branch).decode()
518+
main_branch = self.gl.projects.get(self.id_project).default_branch
519+
contents = self.gl.projects.get(self.id_project).files.get(file_path='.pr_agent.toml', ref=main_branch).decode()
519520
return contents
520521
except Exception:
521522
return ""

0 commit comments

Comments
 (0)