Update CSV Files #414
This file contains 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 CSV Files | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' # Runs at 00:00 UTC every day | |
permissions: | |
contents: write | |
jobs: | |
update_csv: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Install Conda environment with Micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
cache-environment: true | |
environment-file: environment.yml | |
- name: Update CSV files | |
run: ./snotel_ccss_stations/update_csv_files.py | |
- name: Commit and push if there are changes | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Eric Gagliano" | |
git pull | |
git add -A | |
git diff --staged --exit-code || git commit -m "Auto update CSV files" | |
git push |