autoupdatefork.yml 854 B

12345678910111213141516171819202122232425262728
  1. name: Merge upstream release→release
  2. on:
  3. # 推送代码后触发
  4. push:
  5. # 定时任务触发,使用 cron 规则,这里默认一小时执行一次 '0 * * * *'
  6. schedule:
  7. - cron: '0 * * * *'
  8. workflow_dispatch:
  9. jobs:
  10. merge:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v3
  14. - name: Merge upstream
  15. run: |
  16. # 使用自己的用户名替换 username
  17. git config --global user.name 'dlgt7'
  18. git config --global user.email '120@qq.com'
  19. git pull --unshallow
  20. # 自行替换要同步的上游仓库地址
  21. git remote add upstream https://github.com/takagen99/Box.git
  22. git fetch upstream
  23. git checkout main
  24. git merge upstream/main
  25. git pull origin main
  26. git push origin main