name: Check Minecraft Version on: schedule: - cron: '0/15 13-18 * * *' - cron: '0 0,4,8,12 * * *' - cron: '0 19,20,22 * * *' workflow_dispatch: jobs: check_mcv: runs-on: ubuntu-latest steps: - name: 签出储存库 uses: actions/checkout@v4 - name: 配置 Python 环境 uses: actions/setup-python@v4 with: python-version: 3.11 - name: 安装依赖 run: | python -m pip install --upgrade pip pip install requests - name: 运行更新脚本 id: run_script run: python Actions/check_mcv.py >> "$GITHUB_ENV" - name: 显示版本信息 run: | printf '● 最新 %s 版: %s %s\n' "$latest_release_type" "$latest_release_id" printf '● 最新 %s 版: %s %s\n' "$latest_snapshot_type" "$latest_snapshot_id" - name: 配置 Git 信息 if: ${{ env.require_update }} run: | git config --local user.email "bot@bugjump.net" git config --local user.name "Hilda Bot" - name: 配置 GPG 信息 if: ${{ env.require_update }} uses: crazy-max/ghaction-import-gpg@v6 with: gpg_private_key: ${{ secrets.BOT_GPG_PRIVATE_KEY }} git_user_signingkey: true git_commit_gpgsign: true - name: 提交与推送更改 if: ${{ env.require_update }} run: | git add * git diff-index --quiet HEAD || git commit -S -m "preloaded new version" && git push - name: 显示报错信息 if: ${{ failure() && steps.run_script.conclusion == 'failure' }} run: | printf '获取版本列表失败: %s' "$error_log"