Skip to content

Commit

Permalink
fix: gitlab file content issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rajesh-jonnalagadda committed Oct 9, 2024
1 parent 1029b2e commit a49eaa0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions keep/providers/gitlab_provider/gitlab_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def _format_runbook(self, runbook, repo, title, md_path):
runbook_contents = [runbook]

# Filter runbook contents where type is "file"
filtered_runbook_contents = [runbookContent for runbookContent in runbook_contents if runbookContent.get("type") == "file"]
filtered_runbook_contents = [runbookContent for runbookContent in runbook_contents]

# Format the contents using a helper function
contents = [self._format_content(runbookContent, repo) for runbookContent in filtered_runbook_contents]
Expand All @@ -279,9 +279,8 @@ def pull_runbook(self, repo=None, branch=None, md_path=None, title=None):
md_path = md_path if md_path else self.authentication_config.md_path

repo_meta = self.pull_repositories(project_id=repo)

if repo_meta and branch and md_path:
repo_id = repo_meta.get("id")
repo_id = repo_meta.get("id")
if repo_id and branch and md_path:
resp = requests.get(
f"{self.gitlab_host}/api/v4/projects/{repo_id}/repository/files/{md_path}?ref={branch}",
headers=self.__get_auth_header()
Expand Down

0 comments on commit a49eaa0

Please sign in to comment.