forked from otherplane/lisbon-blockchain-week
-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (34 loc) · 1.16 KB
/
update_csv.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
33
34
35
36
37
38
39
40
name: Update CSV
on:
schedule:
# Runs every 4 hours
- cron: '0 */4 * * *'
workflow_dispatch: # This line allows manual trigger
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install gdown
- name: Download CSV from Google Docs
run: |
# This assumes that your Google Docs file is publicly accessible
gdown "https://docs.google.com/spreadsheets/d/1NdCOLpp6u8EHpN6SpeSAwxiJYivawi0YFznZ6AN7fKk/export?format=csv" -O "bbwEvents.csv"
- name: Check for changes and commit
run: |
if ! diff "bbwEvents.csv" ./events.csv ; then
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
cp "bbwEvents.csv" ./events.csv
git add ./events.csv
git commit -m "Update CSV file"
git push
fi