Update Markets #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Markets | |
| on: | |
| schedule: | |
| - cron: '0 * * * *' # Every hour | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| update-markets: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Needed to push changes | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Run Update Script | |
| run: node scripts/update_markets.cjs | |
| - name: Run Validation | |
| run: node scripts/validate_mocks.cjs | |
| - name: Commit and Push if changed | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add src/utils/mock_data.ts | |
| # Check if there are changes | |
| if git diff --staged --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m "chore: auto-update market data" | |
| git push | |
| fi |