generated from technologiestiftung/template-repo-citylab
-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (34 loc) · 1.05 KB
/
onKerndatensaetzeChange.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: Run Script on kerndatensaetz.csv change
# when kerndatensaetz.csv is changed
# run script to update other csv files based on kerndatensaetz.csv
# on:
# push:
# paths:
# - "data/kerndatensaetze-raw.csv"
# pull_request:
# paths:
# - "data/kerndatensaetze-raw.csv"
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
run-script:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install
run: npm install
- name: Run script
run: node scripts/countOccurrences
- name: Commit and Push CSV
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add data/*
git reset HEAD data/kerndatensaetze-raw.csv
git commit -m "updated CSV files based on kerndatensetz csv" || true # The script won't fail if there's nothing to commit
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}