Skip to content

Run conversion.py and upload file #3

Run conversion.py and upload file

Run conversion.py and upload file #3

name: Run conversion.py and upload file
on:
schedule:
- cron: '0 6 * * *' # 每天 UTC 时间 6:00 运行(可根据需求调整)
workflow_dispatch: # 支持手动触发
jobs:
run_script:
runs-on: ubuntu-latest
steps:
# 检出代码
- name: Checkout code
uses: actions/checkout@v3
# 设置 Python 环境
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x' # 设置需要的 Python 版本,可以指定为具体版本号如 3.9
# 安装所需依赖库
- name: Install dependencies
run: |
pip install requests pyyaml
# 运行 Python 脚本
- name: Run conversion.py
run: python conversion.py
# 上传生成的文件到 GitHub Release
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v1
with:
files: output.yaml # 生成文件路径
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}