.github/workflows/run_python_script.yml #170
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |