From 3cb4b49d163ff9e48b2e69b9d16e37cf3b4923a2 Mon Sep 17 00:00:00 2001 From: Ernesto Junior Date: Mon, 13 Apr 2026 22:34:57 -0300 Subject: [PATCH] chore: update sync-mycobank workflow and script for improved execution - Adjusted the cron schedule in the sync-mycobank workflow to run at 4 AM instead of 3 AM. - Added user options for the container to ensure proper permissions during execution. - Modified the dependency installation command to use the local user directory and updated the sync script execution path accordingly. - Changed the base path for downloading MBList to "/tmp/lumm" for better file management. --- .github/workflows/sync-mycobank.yml | 10 ++++++---- scripts/sync_mycobank.py | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sync-mycobank.yml b/.github/workflows/sync-mycobank.yml index 9ea9f9b..78a2b41 100644 --- a/.github/workflows/sync-mycobank.yml +++ b/.github/workflows/sync-mycobank.yml @@ -3,7 +3,7 @@ name: Sync MycoBank on: workflow_dispatch: {} schedule: - - cron: "0 3 1 * *" + - cron: "0 4 1 * *" permissions: contents: read @@ -17,6 +17,7 @@ jobs: runs-on: self-hosted container: image: python:3.12-slim + options: --user 1000:1000 timeout-minutes: 30 env: DATABASE_URL: ${{ secrets.DATABASE_URL }} @@ -31,7 +32,8 @@ jobs: - name: Install dependencies run: | - python -m pip install --upgrade pip uv - uv sync --frozen --no-dev + pip install --user uv + ~/.local/bin/uv sync --frozen --no-dev + - name: Run sync script - run: uv run python scripts/sync_mycobank.py + run: ~/.local/bin/uv run python scripts/sync_mycobank.py diff --git a/scripts/sync_mycobank.py b/scripts/sync_mycobank.py index 2225686..5aba3ba 100644 --- a/scripts/sync_mycobank.py +++ b/scripts/sync_mycobank.py @@ -162,7 +162,7 @@ def main(): _log("=== Coleta do MBList ===") _log("Baixando e lendo MBList") - df, xlsx_path = download_and_read_mblist_filtered(mb_ids=mb_ids) + df, xlsx_path = download_and_read_mblist_filtered(mb_ids=mb_ids, pasta_base="/tmp/lumm") _log(f"XLSX utilizado: {xlsx_path}", "OK") inserted = 0