Update dataset counts #5
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 dataset counts | |
| on: | |
| schedule: | |
| # 毎月1日 AM 6:00 JST (UTC 21:00 前日) に実行 | |
| - cron: '0 21 1 * *' | |
| workflow_dispatch: # 手動実行も可能 | |
| jobs: | |
| update-counts: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: pip install requests | |
| - name: Fetch and count dataset | |
| run: python scripts/count_dataset.py | |
| - name: Commit and push if changed | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add json/counts.json | |
| git diff --staged --quiet || git commit -m "Update dataset counts $(date -u +%Y-%m-%d)" | |
| git push |