Skip to content

Update Markets

Update Markets #10

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