Skip to content

修改脚本

修改脚本 #6

name: Python CI 2
on:
# 每天0点1分触发(UTC时间)
schedule:
- cron: '1 0 * * *'
# 允许手动触发工作流
workflow_dispatch:
# 提交代码到指定分支时触发
push:
branches:
- main # 只在主分支提交时触发
jobs:
build:
runs-on: ubuntu-latest
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
CHAT_ID: ${{ secrets.CHAT_ID }}
# 不需要手动列出每个USER和PASS,脚本会自动识别它们
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Make script executable
run: chmod +x ./generate_config.sh # 赋予执行权限
- name: Generate config.json
run: |
echo "Generating config.json based on environment variables..."
./generate_config.sh
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt # 假设你的项目有 requirements.txt
- name: Run Python script
run: python 69yun.py # 执行你的 Python 脚本