| name: Refresh datasets | |
| on: | |
| schedule: | |
| # 06:00 UTC daily — runs after CalcFi's 05:00 UTC primary-source pull. | |
| - cron: '0 6 * * *' | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: refresh | |
| cancel-in-progress: false | |
| jobs: | |
| refresh: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Refresh datasets | |
| run: node scripts/refresh.mjs | |
| - name: Commit changes | |
| run: | | |
| git config user.name "calcfi-data-bot" | |
| git config user.email "bot@calcfi.app" | |
| if [[ -n $(git status --porcelain) ]]; then | |
| git add datasets/ | |
| git commit -m "chore(data): daily refresh $(date -u +'%Y-%m-%d')" | |
| git push | |
| else | |
| echo "No changes to commit." | |
| fi | |