Skip to content

.github/workflows/run_python_script.yml #161

.github/workflows/run_python_script.yml

.github/workflows/run_python_script.yml #161

name: Run Python Script and Commit JSON
on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: '* */1 * * *'
jobs:
run-script:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests tqdm
- name: Run script
env:
API_KEY: ${{ secrets.API_KEY }}
run: python Clash-Royale-API/Export-to-json/test.py
- name: Commit JSON file
run: |
git config --local user.email "toby91511@gmail.com"
git config --local user.name "Xiang511"
git add ladder_results_json
git add career_results_json
git add profile_results_json
git commit -m "Update JSON" -a || echo "No changes to commit"
git push