Skip to content

Commit

Permalink
fix: support .yaml for dependabot too (#486)
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii authored Sep 6, 2024
1 parent 21c4fd7 commit 53240f9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/sp_repo_review/checks/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ def workflows(root: Traversable) -> dict[str, Any]:


def dependabot(root: Traversable) -> dict[str, Any]:
dependabot_path = root.joinpath(".github/dependabot.yml")
if dependabot_path.is_file():
with dependabot_path.open("rb") as f:
result: dict[str, Any] = yaml.safe_load(f)
return result
dependabot_paths = [
root.joinpath(".github/dependabot.yml"),
root.joinpath(".github/dependabot.yaml"),
]

for dependabot_path in dependabot_paths:
if dependabot_path.is_file():
with dependabot_path.open("rb") as f:
result: dict[str, Any] = yaml.safe_load(f)
return result

return {}

Expand Down

0 comments on commit 53240f9

Please sign in to comment.