-
Notifications
You must be signed in to change notification settings - Fork 1
32 lines (32 loc) · 1007 Bytes
/
update_gov.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: coronaPL gov PL data refresh
on:
push:
branches: [main, master]
schedule:
- cron: '00 10,12 * * *'
jobs:
data_refresh_master:
name: dataset refresh
runs-on: ubuntu-20.04
steps:
- name: checkout_repo
uses: actions/checkout@v2
with:
ref: 'main'
- uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Refresh the data
run: python ./gov/govData.py
- name: Commit changes
run: |
git config --local user.email "$(git log --format='%ae' HEAD^!)"
git config --local user.name "$(git log --format='%an' HEAD^!)"
git remote add github "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY.git"
git pull github ${GITHUB_REF} --ff-only
git add .
if [ -z "$(git status --porcelain)" ]; then
exit 0
fi
git commit -m "Update COVID GOV data"
git push github HEAD:${GITHUB_REF}