From 32d89c3bfc812c9b8e9a2fc84340787fa8b68735 Mon Sep 17 00:00:00 2001 From: Youssef Aitousarrah Date: Mon, 6 Apr 2026 13:44:04 -0700 Subject: [PATCH] fix(ci): restore daily discovery workflow - Add permissions: contents: write so git push works (was failing with 403) - Add continue-on-error: true on discovery step so partial output still commits - Change all commit/tracking/position steps to if: always() so they run regardless of discovery outcome - Use commit-then-pull-rebase-then-push pattern to handle branch divergence - Fix minervini scanner missing from scanners/__init__.py (enabled in config but never loaded) - Fix .gitignore: results/* + !results/discovery/ so CI run logs can be committed Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/daily-discovery.yml | 26 ++++++++++++------- .gitignore | 3 ++- .../dataflows/discovery/scanners/__init__.py | 1 + 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/daily-discovery.yml b/.github/workflows/daily-discovery.yml index dd91475e..bbf079a4 100644 --- a/.github/workflows/daily-discovery.yml +++ b/.github/workflows/daily-discovery.yml @@ -29,6 +29,8 @@ jobs: runs-on: ubuntu-latest environment: TradingAgent timeout-minutes: 30 + permissions: + contents: write steps: - name: Checkout repository @@ -55,6 +57,8 @@ jobs: fi - name: Run discovery pipeline + id: discovery + continue-on-error: true env: # LLM keys (set whichever provider you use) GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} @@ -73,29 +77,31 @@ jobs: --no-update-positions - name: Commit recommendations to repo + if: always() run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - # Stage new/updated recommendation files + # Stage new/updated recommendation and run-log files git add data/recommendations/ || true - git add results/ || true + git add results/discovery/ || true # Only commit if there are changes if git diff --cached --quiet; then echo "No new recommendations to commit" else git commit -m "chore: daily discovery ${{ steps.date.outputs.analysis_date }}" - git push + git pull --rebase origin ${{ github.ref_name }} + git push origin ${{ github.ref_name }} fi - name: Track recommendation performance - if: success() + if: always() run: | python scripts/track_recommendation_performance.py - name: Commit performance updates - if: success() + if: always() run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" @@ -104,18 +110,19 @@ jobs: echo "No performance updates" else git commit -m "chore: update performance tracking ${{ steps.date.outputs.analysis_date }}" - git push + git pull --rebase origin ${{ github.ref_name }} + git push origin ${{ github.ref_name }} fi - name: Update positions - if: success() + if: always() env: FINNHUB_API_KEY: ${{ secrets.FINNHUB_API_KEY }} run: | python scripts/update_positions.py - name: Commit position updates - if: success() + if: always() run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" @@ -124,7 +131,8 @@ jobs: echo "No position updates" else git commit -m "chore: update positions ${{ steps.date.outputs.analysis_date }}" - git push + git pull --rebase origin ${{ github.ref_name }} + git push origin ${{ github.ref_name }} fi - name: Upload results as artifact diff --git a/.gitignore b/.gitignore index 91857b6c..a6b4663f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .venv -results +results/* +!results/discovery/ env/ __pycache__/ .DS_Store diff --git a/tradingagents/dataflows/discovery/scanners/__init__.py b/tradingagents/dataflows/discovery/scanners/__init__.py index 65bb6a55..bd971c11 100644 --- a/tradingagents/dataflows/discovery/scanners/__init__.py +++ b/tradingagents/dataflows/discovery/scanners/__init__.py @@ -6,6 +6,7 @@ from . import ( earnings_calendar, # noqa: F401 insider_buying, # noqa: F401 market_movers, # noqa: F401 + minervini, # noqa: F401 ml_signal, # noqa: F401 options_flow, # noqa: F401 reddit_dd, # noqa: F401