name: CheckScores on: schedule: - cron: "*/30 * * * *" # 每30分钟执行一次 workflow_dispatch: # 允许手动触发workflow jobs: CheckScores: runs-on: ubuntu-latest # 在最新版的Ubuntu系统上运行 steps: - name: Checkout Repository # 使用GitHub Actions提供的动作来检出代码库 uses: actions/checkout@v2 - name: Set up Python # 配置Python环境 uses: actions/setup-python@v2 with: python-version: 3.x # 使用Python 3.x版本 - name: Install dependencies # 使用pip安装项目的依赖项 run: | pip install requests pycryptodome - name: Configure Git # 配置Git用户信息 run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" - name: Fetch upstream changes # 添加上游仓库作为远程仓库,并获取上游仓库的main分支的最新更改 run: | git remote add upstream https://github.com/JiaLiFuNia/HNUScoreChecker.git git fetch upstream master - name: Run main.py # 运行主程序main.py id: run_main_program env: ACCOUNT: ${{ secrets.ACCOUNT }} PASSWORD: ${{ secrets.PASSWORD }} PUSH_PLUS_TOKEN: ${{ secrets.PUSH_PLUS_TOKEN }} run: python main.py