From 15afa681026f3d8e0e0fab3ab94136746e065873 Mon Sep 17 00:00:00 2001 From: dlgt7 <102397160+dlgt7@users.noreply.github.com> Date: Tue, 20 Jun 2023 05:52:54 +0800 Subject: [PATCH] =?UTF-8?q?Create=20=E5=88=A9=E7=94=A8Github=20Actions?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=90=8C=E6=AD=A5Fork.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 利用Github Actions自动同步Fork.md | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 利用Github Actions自动同步Fork.md diff --git a/利用Github Actions自动同步Fork.md b/利用Github Actions自动同步Fork.md new file mode 100644 index 0000000..4e4ac8c --- /dev/null +++ b/利用Github Actions自动同步Fork.md @@ -0,0 +1,39 @@ +Fork其他大神的github项目 +fork别人的github项目,然后更改默认branch为主要活动branch + +源项目默认的主branch基本都是空,为了伪装屏蔽 + +添加Github Actions +点击Actions + +新建自己的actions + +添加如下代码[1] + +# .github/workflows/sync.yml +name: Sync Fork + +on: + push: # push 时触发, 主要是为了测试配置有没有问题 + schedule: + - cron: '* */3 * * *' # 每3小时触发, 对于一些更新不那么频繁的项目可以设置为每天一次, 低碳一点 +jobs: + repo-sync: + runs-on: ubuntu-latest + steps: + - uses: TG908/fork-sync@v1.6.3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + owner: ZhaoUncle # fork 的上游仓库 user + head: main # fork 的上游仓库 branch + base: main # 本地仓库 branch + +owner: 填写上游的项目作者名 + +head: 上游仓库 branch + +base: 本地仓库 branch + +提交action commit + +坐等Github Actions自动更新