check_mcversion.yml 917 B

12345678910111213141516171819202122232425262728293031
  1. name: Check Minecraft Version
  2. on:
  3. schedule:
  4. - cron: '0/20 * * * *'
  5. workflow_dispatch:
  6. jobs:
  7. check_mcv:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: 配置 Git 信息
  11. run: |
  12. git config --local user.email "github-actions[bot]@users.noreply.github.com"
  13. git config --local user.name "GitHub Actions"
  14. - name: 签出储存库
  15. uses: actions/checkout@v4
  16. - name: 配置 Python 环境
  17. uses: actions/setup-python@v4
  18. with:
  19. python-version: 3.11
  20. - name: 安装依赖
  21. run: pip install requests
  22. - name: 运行更新脚本
  23. run: python Actions/check_mcv.py
  24. - name: Configure Git
  25. - name: 提交更改
  26. run: |
  27. git add *
  28. git diff-index --quiet HEAD || git commit -m "preloaded new version"
  29. - name: 推送更改
  30. run: git push