Skip to content

[schedule] Update from API #1430

[schedule] Update from API

[schedule] Update from API #1430

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"