check_mcversion.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. name: Check Minecraft Version
  2. runs-on: self-hosted
  3. on:
  4. schedule:
  5. - cron: '0/30 * * * *'
  6. workflow_dispatch:
  7. jobs:
  8. check_mcv:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - name: 签出储存库
  12. uses: actions/checkout@v4
  13. - name: 配置 Git 信息
  14. run: |
  15. git config --local user.email "[email protected]"
  16. git config --local user.name "Hilda Bot"
  17. - name: 配置 GPG 信息
  18. uses: crazy-max/ghaction-import-gpg@v6
  19. with:
  20. gpg_private_key: ${{ secrets.BOT_GPG_PRIVATE_KEY }}
  21. git_user_signingkey: true
  22. git_commit_gpgsign: true
  23. - name: 配置 Python 环境
  24. uses: actions/setup-python@v4
  25. with:
  26. python-version: 3.11
  27. - name: 安装依赖
  28. run: |
  29. python -m pip install --upgrade pip
  30. pip install requests
  31. - name: 运行更新脚本
  32. run: python Actions/check_mcv.py
  33. - name: 提交更改
  34. run: |
  35. git add *
  36. git diff-index --quiet HEAD || git commit -S -m "preloaded new version"
  37. - name: 推送更改
  38. run: git push