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 <noreply@anthropic.com>
This commit is contained in:
parent
719a2d3f4e
commit
32d89c3bfc
|
|
@ -29,6 +29,8 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: TradingAgent
|
environment: TradingAgent
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
|
@ -55,6 +57,8 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Run discovery pipeline
|
- name: Run discovery pipeline
|
||||||
|
id: discovery
|
||||||
|
continue-on-error: true
|
||||||
env:
|
env:
|
||||||
# LLM keys (set whichever provider you use)
|
# LLM keys (set whichever provider you use)
|
||||||
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
||||||
|
|
@ -73,29 +77,31 @@ jobs:
|
||||||
--no-update-positions
|
--no-update-positions
|
||||||
|
|
||||||
- name: Commit recommendations to repo
|
- name: Commit recommendations to repo
|
||||||
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
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 data/recommendations/ || true
|
||||||
git add results/ || true
|
git add results/discovery/ || true
|
||||||
|
|
||||||
# Only commit if there are changes
|
# Only commit if there are changes
|
||||||
if git diff --cached --quiet; then
|
if git diff --cached --quiet; then
|
||||||
echo "No new recommendations to commit"
|
echo "No new recommendations to commit"
|
||||||
else
|
else
|
||||||
git commit -m "chore: daily discovery ${{ steps.date.outputs.analysis_date }}"
|
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
|
fi
|
||||||
|
|
||||||
- name: Track recommendation performance
|
- name: Track recommendation performance
|
||||||
if: success()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
python scripts/track_recommendation_performance.py
|
python scripts/track_recommendation_performance.py
|
||||||
|
|
||||||
- name: Commit performance updates
|
- name: Commit performance updates
|
||||||
if: success()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
@ -104,18 +110,19 @@ jobs:
|
||||||
echo "No performance updates"
|
echo "No performance updates"
|
||||||
else
|
else
|
||||||
git commit -m "chore: update performance tracking ${{ steps.date.outputs.analysis_date }}"
|
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
|
fi
|
||||||
|
|
||||||
- name: Update positions
|
- name: Update positions
|
||||||
if: success()
|
if: always()
|
||||||
env:
|
env:
|
||||||
FINNHUB_API_KEY: ${{ secrets.FINNHUB_API_KEY }}
|
FINNHUB_API_KEY: ${{ secrets.FINNHUB_API_KEY }}
|
||||||
run: |
|
run: |
|
||||||
python scripts/update_positions.py
|
python scripts/update_positions.py
|
||||||
|
|
||||||
- name: Commit position updates
|
- name: Commit position updates
|
||||||
if: success()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
@ -124,7 +131,8 @@ jobs:
|
||||||
echo "No position updates"
|
echo "No position updates"
|
||||||
else
|
else
|
||||||
git commit -m "chore: update positions ${{ steps.date.outputs.analysis_date }}"
|
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
|
fi
|
||||||
|
|
||||||
- name: Upload results as artifact
|
- name: Upload results as artifact
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
.venv
|
.venv
|
||||||
results
|
results/*
|
||||||
|
!results/discovery/
|
||||||
env/
|
env/
|
||||||
__pycache__/
|
__pycache__/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ from . import (
|
||||||
earnings_calendar, # noqa: F401
|
earnings_calendar, # noqa: F401
|
||||||
insider_buying, # noqa: F401
|
insider_buying, # noqa: F401
|
||||||
market_movers, # noqa: F401
|
market_movers, # noqa: F401
|
||||||
|
minervini, # noqa: F401
|
||||||
ml_signal, # noqa: F401
|
ml_signal, # noqa: F401
|
||||||
options_flow, # noqa: F401
|
options_flow, # noqa: F401
|
||||||
reddit_dd, # noqa: F401
|
reddit_dd, # noqa: F401
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue