Skip to content

Commit

Permalink
fix: unshallow the repository on alfred github.notify-changes-doc on …
Browse files Browse the repository at this point in the history
…github action
  • Loading branch information
FabienArcellier committed Oct 1, 2024
1 parent 0f556ad commit 9f4af7b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion alfred/github.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import logging
import os.path
from typing import Any, List, Tuple

import requests
Expand Down Expand Up @@ -41,7 +42,12 @@ def notify_doc_changes(remote: str, branch: str, commit: str, dry: bool, slack_w
file_changes: List[Tuple[str, str]] = []
component_added: List[Tuple[str, str]] = []
documentation_changes: List[Tuple[str, str]] = []
alfred.run(f"git fetch {remote} {branch}")

_, stdout, _ = alfred.run("git rev-parse --is-shallow-repository")
if stdout.strip() == "true":
alfred.run(f"git fetch --unshallow {remote} {branch}")
else:
alfred.run(f"git fetch {remote} {branch}")

for change in all_change_types:
_, stdout, _ = alfred.run(f"git diff --name-only --diff-filter={change} {commit}^ {commit}")
Expand Down

0 comments on commit 9f4af7b

Please sign in to comment.