-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (40 loc) · 1.46 KB
/
update-from-api.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
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
name: "[schedule] Update from API"
jobs:
data_update:
runs-on: ubuntu-latest
name: Update data from API
steps:
# Check out the specified branch of the current repository.
- name: Checkout
uses: actions/checkout@v2
with:
ref: 'develop'
token: ${{ secrets.PAT_REPO }}
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r .github/actions/data-update/requirements.txt
- name: Update data from API
env:
GITHUB_PAT: ${{ secrets.PAT_PUBLIC }}
EXTERNAL_CONTRIBUTIONS_FILE: .github/actions/data-update/input/external_contributions.csv
OUTPUT_DATA_DIR: ./src/data
run: |
python .github/actions/data-update/src/main.py
# Commit and push any changes matching the specified pattern. Commit to the checked out branch.
# The automation action will always change the last_update file. Hence, this step always results
# in a commit.
- name: Commit & push
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[AUTO] Update data."
file_pattern: "src/data/*.json src/data/last_update"