Skip to content

update-csv

update-csv #278

Workflow file for this run

name: update-csv
on:
schedule:
- cron: 0 21 * * *
workflow_dispatch:
jobs:
update-csv:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11' # Use the version of Python that matches your project's requirements
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Update CSV and write to backup file
run: |
python entrypoint.py
- name: Commit and push if there are changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add data/2024.csv
git add data/backup/*
git pull origin main
git commit -m 'Updated data with latest standings' || echo 'No changes to commit'
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}