Skip to content

Scheduled Merge and Generate CSV #6896

Scheduled Merge and Generate CSV

Scheduled Merge and Generate CSV #6896

name: Scheduled Merge and Generate CSV
on:
push:
workflow_dispatch:
schedule:
- cron: '0 0/6 * * *'
jobs:
merge-upstream:
runs-on: ubuntu-latest
steps:
- name: Check out this repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch upstream
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
git remote add upstream https://github.com/nychealth/coronavirus-data.git
git fetch upstream
git merge upstream/master
git push origin master
- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: install python packages
run: |
python -m pip install --upgrade pip
pip install -r pressnyc/parse/requirements.txt
- name: execute pressnyc/parse/hospitalization-and-death.py
run: python pressnyc/parse/hospitalization-and-death.py
- name: execute pressnyc/parse/hospitalization-and-death-daily.py
run: python pressnyc/parse/hospitalization-and-death-daily.py
- name: Commit and push if it changed
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
git add -A
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git push