之前遇到一个问题,我在 GitHub 仓库上 fork 了别人的项目,然后需要同步更新的时候就非常麻烦,网上查了一圈,要么是通过网页操作,要么克隆仓库后通过命令行操作,对我这种懒人来说真的好麻烦,下面记录一下我通过大量搜索后选择的解决方案通过使用GitHub Actions功能来解决这一问题。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| on: push: branches: -master schedule: - cron: 0 */12 * * * jobs: update_external_airflow_fork: runs-on: ubuntu-latest steps: - uses: TobKed/github-forks-sync-action@master with: github_token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} upstream_repository: luolongfei/freenom target_repository: leicancun/freenom upstream_branch: master target_branch: master force: true tags: true
|
原动作仓库地址:点我查看
更多GitHub Actions动作请查看:我的收藏夹