全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 2246|回复: 11

GitHub fork了别人的项目,当别人更新时,我这边怎么同步更新

[复制链接]
发表于 2023-5-17 15:27:30 | 显示全部楼层 |阅读模式
rt
imes 该用户已被删除
发表于 2023-5-17 15:28:41 来自手机 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2023-5-17 15:29:55 | 显示全部楼层
  1. name: Upstream Sync

  2. permissions:
  3.   contents: write

  4. on:
  5.   schedule:
  6.     - cron: "0 0 * * *" # every day
  7.   workflow_dispatch:

  8. jobs:
  9.   sync_latest_from_upstream:
  10.     name: Sync latest commits from upstream repo
  11.     runs-on: ubuntu-latest
  12.     if: ${{ github.event.repository.fork }}

  13.     steps:
  14.       # Step 1: run a standard checkout action
  15.       - name: Checkout target repo
  16.         uses: actions/checkout@v3

  17.       # Step 2: run the sync action
  18.       - name: Sync upstream changes
  19.         id: sync
  20.         uses: aormsby/Fork-Sync-With-Upstream-action@v3.4
  21.         with:
  22.           upstream_sync_repo: Yidadaa/ChatGPT-Next-Web
  23.           upstream_sync_branch: main
  24.           target_sync_branch: main
  25.           target_repo_token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, no need to set

  26.           # Set test_mode true to run tests instead of the true action!!
  27.           test_mode: false

  28.       - name: Sync check
  29.         if: failure()
  30.         run: |
  31.           echo "::error::由于权限不足,导致同步失败(这是预期的行为),请前往仓库首页手动执行[Sync fork]。"
  32.           echo "::error::Due to insufficient permissions, synchronization failed (as expected). Please go to the repository homepage and manually perform [Sync fork]."
  33.           exit 1
复制代码
 楼主| 发表于 2023-5-17 15:30:09 | 显示全部楼层
imes 发表于 2023-5-17 15:28
右上角有个fetch upstream,点一下就能同步了

谢谢 可以自动同步更新吗?
 楼主| 发表于 2023-5-17 15:36:24 | 显示全部楼层

所以 这怎么用
发表于 2023-5-17 15:42:03 | 显示全部楼层

这明显是一个 github action 的配置文件。
发表于 2023-5-17 17:11:23 来自手机 | 显示全部楼层
有个bot,pull
发表于 2023-5-17 17:48:09 | 显示全部楼层
https://github.com/apps/pull

在自己的仓库里创建配置文件 /.github/pull.yml

  1. version: '1'
  2. rules:
  3.   - base: main
  4.     upstream: wei:master
  5.     # default value if this file does not exist is `hardreset`, effectively overwriting any downstream changes!
  6.     # previously it was the misconfigured PR route test workflow that rescued downstream changes from being overwritten
  7.     mergeMethod: merge
  8.     mergeUnstable: true # prevent non-pass tests from preventing automatic merge
复制代码


upstream: 按照你原仓库修改
发表于 2023-5-17 17:52:10 来自手机 | 显示全部楼层
个把月才同一次,不是新的就好
发表于 2023-5-17 17:53:23 | 显示全部楼层
lowan 发表于 2023-5-17 17:48
https://github.com/apps/pull

在自己的仓库里创建配置文件 /.github/pull.yml

学习了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-21 07:37 , Processed in 0.068564 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表