check_mcversion.yml 948 B

1234567891011121314151617181920212223242526272829303132
  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: |
  22. python -m pip install --upgrade pip
  23. pip install requests
  24. - name: 运行更新脚本
  25. run: python Actions/check_mcv.py
  26. - name: 提交更改
  27. run: |
  28. git add *
  29. git diff-index --quiet HEAD || git commit -m "preloaded new version"
  30. - name: 推送更改
  31. run: git push