mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-15 16:04:18 +00:00
fix: logic of security.md retrieval
This commit is contained in:
1 file changed
+9
-1
@@ -17,7 +17,15 @@ class Repository(GithubService):
|
||||
try:
|
||||
for repo in self.client.get_user().get_repos():
|
||||
try:
|
||||
securitymd_exists = repo.get_contents("SECURITY.md") is not None
|
||||
securitymd_exists = False
|
||||
contents = repo.get_contents("")
|
||||
while contents:
|
||||
file_content = contents.pop(0)
|
||||
if file_content.type == "dir":
|
||||
contents.extend(repo.get_contents(file_content.path))
|
||||
elif file_content.path.endswith("SECURITY.md"):
|
||||
securitymd_exists = True
|
||||
break
|
||||
except Exception:
|
||||
securitymd_exists = False
|
||||
repos[repo.id] = Repo(
|
||||
|
||||
Reference in new issue
Block a user