diff --git a/.github/workflows/update-citations.yml b/.github/workflows/update-citations.yml index 8a2428d..80d51ba 100644 --- a/.github/workflows/update-citations.yml +++ b/.github/workflows/update-citations.yml @@ -49,7 +49,7 @@ jobs: set +e echo "🚀 Running citation update script (single attempt)..." start_time=$(date) - timeout 90 python bin/update_scholar_citations.py + timeout 300 python bin/update_scholar_citations.py status=$? end_time=$(date) if [ $status -eq 0 ]; then @@ -93,6 +93,10 @@ jobs: - name: Commit and push if changed run: | + if [ ! -f _data/citations.yml ]; then + echo "â„šī¸ No citations.yml file to commit." + exit 0 + fi git add _data/citations.yml git diff --staged --quiet || ( echo "📤 Committing and pushing changes..." diff --git a/bin/update_scholar_citations.py b/bin/update_scholar_citations.py index 1c4f57c..f229587 100644 --- a/bin/update_scholar_citations.py +++ b/bin/update_scholar_citations.py @@ -42,6 +42,7 @@ def get_scholar_citations() -> None: today = datetime.now().strftime("%Y-%m-%d") # Check if the output file was already updated today + existing_data = None if os.path.exists(OUTPUT_FILE): try: with open(OUTPUT_FILE, "r") as f: @@ -62,7 +63,7 @@ def get_scholar_citations() -> None: citation_data = {"metadata": {"last_updated": today}, "papers": {}} - scholarly.set_timeout(15) + scholarly.set_timeout(30) scholarly.set_retries(3) try: author = scholarly.search_author_id(SCHOLAR_USER_ID)