Github 自动同步上游 Fork
以前用GitHub - wei/pull: 🤖 Keep your forks up-to-date via automated PRs发现隔断时间就抽风,遂改用
action
实现预期结果:自动同步上游fork的项目,上游项目的action流不自动运行
同步的上游项目:GitHub - firefly-iii/firefly-iii: Firefly III: a personal finances manager
使用的同步action:Fork Sync · Actions · GitHub Marketplace · GitHub
1、创建本地同步
2、fork项目
-
打开GitHub - firefly-iii/firefly-iii: Firefly III: a personal finances manager
-
点击
fork
-
项目--
settings
--Action
--General
--Actions permissions
选择Allow
your-usernameactions and reusable workflows
- 点击
Save
3、新建自动同步action流
新建.github/workflows/Sync-Fork.yml
Sync-Fork.yml
name: Sync Fork
on:
schedule:
- cron: '1 3 * * *' # (1)!
workflow_dispatch: # (2)! on button click
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: your-username/fork-sync@master
with:
owner: your-fork-username
base: main
head: main
- every 30 minutes
- on button click
4、测试
点击Actions
,选择Sync Fork
,点击运行