Skip to content

Run Python Script #1033

Run Python Script

Run Python Script #1033

Workflow file for this run

name: Run Python Script
on:
# push:
# branches:
# - main
schedule:
- cron: '*/60 * * * *' # 每小时运行一次
workflow_dispatch:
jobs:
run-script:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: List files in the repository root
run: ls -la
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x' # 使用 Python 3.x 版本
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./requirements.txt # 假设你的脚本需要 requests 库
- name: Run the script
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
run: |
echo "Running the script... ${GITHUB_TOKEN}"
python github.py "$GITHUB_TOKEN" # 传递环境变量作为命令行参数