diff --git a/.github/workflows/autoupdatefork.yml b/.github/workflows/autoupdatefork.yml new file mode 100644 index 0000000000000..3f1077bd7f6ff --- /dev/null +++ b/.github/workflows/autoupdatefork.yml @@ -0,0 +1,34 @@ +#更新fork +name: update fork + +on: + repository_dispatch: + workflow_dispatch: + schedule: + - cron: '50 7 * * *' #设置定时任务 +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + token: ${{ secrets.WORKFLOW_TOKEN }} + - name: Set env + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + - name: Update fork master + run: | + git remote add upstream https://github.com/mpv-player/mpv.git + git remote -v + git fetch upstream + git checkout master || git checkout -b master origin/master + git merge --strategy-option=ours upstream/master + git push -f origin master + - name: Update fork patch + run: | + git checkout patch || git checkout -b patch origin/patch + git rebase --strategy-option=ours upstream/master + git push -f origin patch \ No newline at end of file