以前用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、创建本地同步

  1. 打开Fork Sync · Actions · GitHub Marketplace · GitHub

  2. 点击fork

2、fork项目

  1. 打开GitHub - firefly-iii/firefly-iii: Firefly III: a personal finances manager

  2. 点击fork

  3. 项目–settingsActionGeneralActions permissions

    选择Allow your-username actions and reusable workflows

  4. 点击Save

3、新建自动同步action流

新建.github/workflows/Sync-Fork.yml

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
name: Sync Fork

on:
  schedule:
    - cron: '1 3 * * *' # every 30 minutes
  workflow_dispatch: # 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

4、测试

点击Actions,选择Sync Fork,点击运行