fix: logic of security.md retrieval

This commit is contained in:
HugoPBrito committed 2024-11-22 11:48:14 +01:00
1 parent 5ee960e13d
commit cac7c42f13
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(