Skip to content

Commit

Permalink
create commit
Browse files Browse the repository at this point in the history
  • Loading branch information
geritwagner committed Jan 28, 2025
1 parent 2b0e60b commit 331eabe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions labot/notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import colrev.loader.load_utils
from colrev.packages.crossref.src import crossref_api
from colrev.writer.write_utils import write_file
from git import Repo

references_file = Path("references.bib")

Expand Down Expand Up @@ -112,14 +113,10 @@ def import_missing_references(missing_references: list, references: dict) -> Non
write_file(records_dict=references, filename=references_file)


def check_notes() -> None:
def check_notes(local_repo: Repo = None) -> None:

event_name = os.getenv("GITHUB_EVENT_NAME")

if event_name == "pull_request":
print("CALLED")
return

pdfs = list(Path("pdfs").iterdir())
papers = list(Path("papers").iterdir())
# concepts = list(Path('concepts').iterdir())
Expand All @@ -136,6 +133,11 @@ def check_notes() -> None:
for missing_paper_summary in missing_paper_summaries:
create_paper_summary(missing_paper_summary, references)

if event_name == "pull_request":
assert local_repo
local_repo.git.add("--all")
local_repo.index.commit("Updates")


if __name__ == "__main__":
check_notes()
2 changes: 1 addition & 1 deletion labot/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def validate_structure(content: str, expected_title: str) -> bool:
def _run_knowledge_repo_checks(self) -> None:
"""Run checks specific to the knowledge repository."""

labot.notes.check_notes()
labot.notes.check_notes(self.local_repo)

references = colrev.loader.load_utils.load(
filename=Path("references.bib"),
Expand Down

0 comments on commit 331eabe

Please sign in to comment.