name: Daily Data Update on: schedule: - cron: '0 12 * * *' # Runs at 12:00 UTC daily workflow_dispatch: # Allows manual trigger from GitHub Actions tab jobs: update-and-commit: runs-on: ubuntu-latest permissions: contents: write steps: - name: Checkout repository uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.11' - name: Install dependencies run: | pip install pandas requests - name: Run update script env: FINNHUB_KEY: ${{ secrets.FINNHUB_KEY }} run: python update_data.py - name: Commit and push changes run: | git config --global user.name 'GitHub Action' git config --global user.email 'action@github.com' git add data/ai_sentiment.csv # Only commit if there are changes git diff --quiet && git diff --staged --quiet || (git commit -m "Daily data update [skip ci]" && git push)