-
-
Notifications
You must be signed in to change notification settings - Fork 20
48 lines (47 loc) · 1.71 KB
/
check_mcversion.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Check Minecraft Version
on:
schedule:
- cron: '0/30 * * * *'
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" "$latest_release_act"
printf '● 最新 %s 版: %s %s\n' "$latest_snapshot_type" "$latest_snapshot_id" "$latest_snapshot_act"
- 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"