From 0d3ffda107ccc9180aed73d450c6d2ca38678e06 Mon Sep 17 00:00:00 2001 From: sakura_bot <1592330653su@gmail.com> Date: Mon, 17 Aug 2020 21:51:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=8A=A8=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/autoupdatefork.yml | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/autoupdatefork.yml diff --git a/.github/workflows/autoupdatefork.yml b/.github/workflows/autoupdatefork.yml new file mode 100644 index 000000000..6392e1908 --- /dev/null +++ b/.github/workflows/autoupdatefork.yml @@ -0,0 +1,39 @@ +#更新fork +name: update fork + +on: + release: + types: [published] + push: + tags: + - 'v*' + schedule: + - cron: '50 3 * * *' #设置定时任务 + watch: + types: [started] +#修改[用户名],设置token并命名为GITHUB_TOKEN,具体方法百度 +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install git + run: | + sudo apt-get update + sudo apt-get -y install git + - name: Download Repository + run: | + git clone https://github.com/[用户名]/legado.git /opt/legado + - name: Update fork + run: | + cd /opt/legado + git remote -v + git remote rm origin + git remote add origin https://[用户名]:${{ secrets.GITHUB_TOKEN }}@github.com/[用户名]/legado.git + git remote add upstream https://github.com/gedoor/legado.git + git remote -v + git fetch upstream + git checkout master + git merge upstream/master + git push origin master