Persist CSV database to Git commit #965
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: Persist CSV database to Git commit | |
on: | |
schedule: | |
# At 5am every day | |
- cron: 0 5 * * * | |
workflow_dispatch: | |
jobs: | |
persist-csv-database-to-git-commit: | |
name: Persist CSV database to Git commit | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
permissions: | |
# Write permissions for $GITHUB_TOKEN (to commit and push) | |
contents: write | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: pnpm/action-setup@v4 | |
- uses: actions/setup-node@v5 | |
with: | |
node-version: '22.19.0' | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- run: node scripts/updateCsvDatabaseRecords.ts data/persisted-to-git/database.csv | |
- name: Commit files | |
run: | | |
git config user.email [email protected] | |
git config user.name github-actions | |
git add data/persisted-to-git/database.csv | |
git commit -m "Update CSV database with new records" | |
git push |