check_mcversion.yml 1.1 KB

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