Skip to content

Update main.yml

Update main.yml #3

Workflow file for this run

name: Run Python script and update image
on:
push:
branches:
- main # 或者你想要运行这个工作流的分支
jobs:
run-script:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests matplotlib pandas mplcyberpunk
- name: Run script
run: python ./source/main.py # 替换为你的Python脚本文件名
- name: Commit and push if it changed
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git diff --quiet && git diff --staged --quiet || git commit -m "Update image"
git push --allow-unrelated-histories