-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (34 loc) · 1.13 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
41
42
43
name: Update CSV-files
on:
schedule:
# Run weekly. Random numbers are used to avoid high load times and in turn being dropped.
- cron: "40 12 * * 5"
workflow_dispatch:
jobs:
update-csv:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Update the CSV-files
run: python update.py
shell: bash
- uses: stefanzweifel/git-auto-commit-action@v5
id: auto-commit-action
with:
commit_message: Auto-update
file_pattern: '*.csv'
- name: "Run if changes have been detected"
if: steps.auto-commit-action.outputs.changes_detected == 'true'
run: echo "The data was changed!"
- name: "Run if no changes have been detected"
if: steps.auto-commit-action.outputs.changes_detected == 'false'
run: echo "No changes in the data!"