Refresh dashboard data #4
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: Refresh dashboard data | |
| on: | |
| schedule: | |
| - cron: "30 4 * * *" | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| paths-ignore: [data.json] | |
| permissions: | |
| contents: write | |
| jobs: | |
| refresh: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build data.json | |
| run: node scripts/build-data.mjs | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Commit if changed | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add data.json | |
| git diff --cached --quiet || { git commit -m "chore: refresh dashboard data"; git push; } |