Skip to content

GetEarningsData

GetEarningsData #650

name: GetEarningsData
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * *'
jobs:
build:
runs-on: macos-13
if: github.ref == 'refs/heads/master'
steps:
- name: Check out repo
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: actions/cache@v2
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python dependencies
run: |
python -m pip install -r ./.github/script/requirements.txt
- name: get earnings data
run: |-
python ./.github/script/build_similar-earning-data.py
- name: Commit and push if data changed
run: |-
git config --global user.email "zmcx16-bot@zmcx16.moe"
git config --global user.name "zmcx16-bot"
git config --global pull.ff only
git pull
git diff
git diff --quiet || (git add *.json && git commit -m "Updated earnings data")
git push