autoupdatefork.yml 841 B

1234567891011121314151617181920212223242526272829303132
  1. #更新fork
  2. name: update fork
  3. on:
  4. schedule:
  5. - cron: '0 16 * * *' #设置定时任务
  6. jobs:
  7. build:
  8. runs-on: ubuntu-latest
  9. if: ${{ github.event.repository.owner.id == github.event.sender.id && github.actor != 'gedoor' }}
  10. steps:
  11. - name: Checkout
  12. uses: actions/checkout@v3
  13. with:
  14. fetch-depth: 0
  15. - name: Install git
  16. run: |
  17. sudo apt-get update
  18. sudo apt-get -y install git
  19. - name: Set env
  20. run: |
  21. git config --global user.email "github-actions@github.com"
  22. git config --global user.name "github-actions"
  23. - name: Update fork
  24. run: |
  25. git remote add upstream https://github.com/gedoor/legado.git
  26. git remote -v
  27. git fetch upstream
  28. git checkout master
  29. git merge upstream/master
  30. git push origin master