Run Python Script and Commit CSV #1104
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 CSV | |
on: | |
push: | |
branches: | |
- main # 触发动作的分支 | |
schedule: | |
# 每天UTC时间00:00运行,按需调整 | |
- cron: '0 * * * *' | |
jobs: | |
build-and-commit-csv: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' # 你的 Python 版本 | |
- name: Configure Git | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "qqhsx" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pywencai | |
- name: Run Python script | |
run: | | |
python wencai.py | |
env: | |
KEYWORD: ${{ secrets.KEYWORD }} | |
- name: Run Custom data script | |
run: | | |
python popularity.py | |
- name: Commit changes | |
run: | | |
git add . | |
git commit --allow-empty -m "spider" | |
git push |